-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserver.bat
More file actions
100 lines (94 loc) · 2.48 KB
/
server.bat
File metadata and controls
100 lines (94 loc) · 2.48 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
:: Server Commandline Interface for Windows
:: Example using; server -run
:: "server" calling server.bat and %1 is "-run"
@echo off && rem #!/bin/bash
:: Buradan itibaren 1. parametre boş ise olacakları yapıyor
set null=false
if "%1"=="" (
set null=true
)
if %null%==true (
echo UnViewed ServerCI v0.0.0.1 Copyright C 2023 Yasir Eymen KAYABASI
echo Type "-help" for more information
exit /b 0 && rem Bu "exit /b 0" kavrammı Bash'de "exit 0" anlamına geliyor
)
:: Boş ise yapılacaklar burada bitiyor
if %1==--run (
if exist node_modules (
node src/index.js
exit /b 0
) else (
npm install
node src/index.js
exit /b 0
)
) else if %1==--install (
if "%2"=="" (
if exist node_modules (
echo Node modules already installed
exit /b 0
) else (
npm install
exit /b 0
)
) else (
if exist node_modules/%2 (
echo This module already installed
exit /b 0
) else (
npm add %2
exit /b 0
)
)
) else if %1==--update (
npm update
echo Updated to latest version
exit /b 0
) else if %1==-login (
if "%2"=="" (
echo Please enter Google Apps Script Project ID
) else (
echo Trying login
if exist .env (
echo You already logged in
exit /b 0
) else (
echo Logging in
echo # Google Apps Script Project ID>>.env
echo GS_ID=%2>>.env
echo # Application PORT>>.env
echo PORT=3000>>.env
exit /b 0
)
)
) else if %1==--compile (
cd src/ts
npx tsc
cd ..
cd ..
) else if %1==--decompile (
cd src/ts
del db.js
echo Codes decompiled
cd ..
cd ..
) else if %1==--version (
echo UnViewed ServerCI Version 0.0.0.1
exit /b 0
) else if %1==--help (
echo ServerCI: The Commandline Interface For UnViewed Server - Version 0.0.0.1
echo.
echo COMMANDS
echo.
echo --help More information about ServerCI.
echo --version Learn version.
echo --install Install packages.
echo --run Run server in localhost.
echo --update Update NodeJS and ServerCI.
echo --login Login to Google Apps Script.
echo --compile Compile codes to run.
echo --decompile Decompile codes to run.
) else (
echo An error occurred: This command not found
)
exit /b 0