-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserver.sh
More file actions
94 lines (88 loc) · 2.42 KB
/
server.sh
File metadata and controls
94 lines (88 loc) · 2.42 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
#!/bin/bash
null=false
if [ -z "$1" ]; then
null=true
fi
if [ "$null" == true ]; then
echo "UnViewed ServerCI v0.0.0.1 Copyright C 2023 Yasir Eymen KAYABASI"
echo "Type 'help' for more information"
exit 0
fi
if [ "$1" == "--run" ]; then
if [ -d "node_modules" ]; then
node src/index.js
exit 0
else
npm install
node src/index.js
exit 0
fi
elif [ "$1" == "--install" ]; then
if [ -z "$2" ]; then
if [ -d "node_modules" ]; then
echo "Node modules already installed"
exit 0
else
npm install
exit 0
fi
else
if [ -e "node_modules/$2" ]; then
echo "This module already installed"
exit 0
else
npm add "$2"
exit 0
fi
fi
elif [ "$1" == "--update" ]; then
npm update
echo "Updated to the latest version"
exit 0
elif [ "$1" == "--login" ]; then
if [ -z "$2" ]; then
echo "Please enter Google Apps Script Project ID"
else
echo "Trying login"
if [ -e ".env" ]; then
echo "You already logged in"
exit 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 0
fi
fi
elif [ "$1" == "--compile" ]; then
cd src/ts || exit
npx tsc
cd ../..
elif [ "$1" == "--decompile" ]; then
cd src/ts || exit
rm -f db.js
echo "Codes decompiled"
cd ../..
elif [ "$1" == "--version" ]; then
echo "UnViewed ServerCI Version 0.0.0.1"
exit 0
elif [ "$1" == "--help" ]; then
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"
fi
exit 0
# Code of the original Starwalker