From aee0a8967c14f4b0b898d67738a25cecfbe3ed20 Mon Sep 17 00:00:00 2001 From: Erica Marigold Date: Thu, 28 Mar 2024 17:21:13 +0530 Subject: [PATCH] chore: include lunew as batch script too --- lunew.bat | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 lunew.bat diff --git a/lunew.bat b/lunew.bat new file mode 100644 index 0000000..99f18ab --- /dev/null +++ b/lunew.bat @@ -0,0 +1,28 @@ +@ECHO OFF + +rem Check if lune is installed +where lune > NUL 2>&1 ( + rem Get lune version + FOR /F "tokens=2 delims=' ' " %%a IN ('lune --version') DO SET lune_version=%%a + rem Check if version is greater than or equal to 8 using substring comparison + IF "%lune_version:~-1%" GEQ 8 ( + rem CUSTOM EXAMPLE RUNNER BEGIN + IF "%~1%"=="example" ( + SET filename=%~2% + IF "%filename%"=="" ( + ECHO. Usage: %0 example [ARGS] + EXIT /B 1 + ) + SHIFT 2 + lune run "examples\%filename%.luau" %* + EXIT /B %ERRORLEVEL% + ) + rem CUSTOM EXAMPLE RUNNER END + + IF EXIST "%1*" (lune run %*) ELSE IF EXIST ".lune\%1*" (lune run %*) + ) ELSE ( + lune %* + ) +) + +EXIT /B %ERRORLEVEL%