chore: include lunew as batch script too

This commit is contained in:
Erica Marigold 2024-03-28 17:21:13 +05:30 committed by GitHub
parent ce7cea38c3
commit aee0a8967c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

28
lunew.bat Normal file
View file

@ -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 <example_name> [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%