-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclankp.bat
58 lines (44 loc) · 968 Bytes
/
clankp.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
@echo off
setlocal
REM Change directory to the current script directory
set DIR=%~dp0
cd %DIR%
set SCRIPT=%~0
IF "%~1" == "debug" GOTO exec
IF "%~1" == "run" GOTO exec
IF "%~1" == "r" GOTO exec
IF "%~1" == "d" GOTO exec
goto menu
:check_installed
where %~1 2>nul
if %ERRORLEVEL% NEQ 0 (
set /A "%~2 = 1"
) else (
set /A "%~2 = 0"
)
exit /B 0
:require_installed
call :check_installed %~1, status
if %status% == 0 (
echo %~1 ^(%~2^) is not installed, please install it!
exit /B 100
)
exit /B 0
:exec
call :require_installed "lua", "Lua 5.3+"
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
REM Remove 1st parameter from %*
set _tail=%*
call set _tail=%%_tail:*%1=%%
REM Run runner
lua lib\runner.lua %_tail%
exit /B 0
REM Menu
:menu
echo ========================
echo Clank Plugin Dev Utility
echo ========================
echo.
echo Commands:
echo * debug,run,d,r [plugin] .... Debug a specific plugin or all plugins
goto :eof