-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbot.bat
74 lines (65 loc) · 1.64 KB
/
bot.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
@echo off
rem Function definitions
:start
rem Clean the old build
rmdir /s /q dist 2>nul
rem Convert TypeScript code to JavaScript code
tsc
rem Run the code
node dist/index.js
goto :eof
:dev
rem Clean the old build
rmdir /s /q dist 2>nul
rem Convert TypeScript code to JavaScript code
tsc
rem Run the code with nodemon
nodemon dist/index.js
goto :eof
:build
rem Clean the old build
rmdir /s /q dist 2>nul
rem Convert TypeScript code to JavaScript code
tsc
goto :eof
:clean
rem Clean the old build
rmdir /s /q dist 2>nul
goto :eof
:help
rem Print the possible options
echo ##[ Possible options]##:
rem Start option
echo "- start:"
echo "clean the old build and rebuild the ts code to js code and run"
rem dev option
echo "- dev:"
echo "run the code with nodemon"
rem build option
echo "- build:"
echo "build the ts code to js code"
rem Clean option
echo "- clean:"
echo "clean the JavaScript build"
goto :eof
:default
rem Print the possible options
echo # Possible options:
echo "start, dev, build, clean, help"
goto :eof
rem Get the argument from the prompt
set "opt=%~1"
rem Switch case
if "%opt%"=="start" goto :start
if "%opt%"=="run" goto :start
if "%opt%"=="--start" goto :start
if "%opt%"=="--run" goto :start
if "%opt%"=="clean" goto :clean
if "%opt%"=="clear" goto :clean
if "%opt%"=="--clean" goto :clean
if "%opt%"=="--clear" goto :clean
if "%opt%"=="help" goto :help
if "%opt%"=="--help" goto :help
if "%opt%"=="-h" goto :help
rem If none of the recognized options are provided
goto :default