-
Notifications
You must be signed in to change notification settings - Fork 1
/
run
executable file
·54 lines (54 loc) · 1.05 KB
/
run
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
#!/bin/bash
# Code adapted from https://www.redhat.com/sysadmin/process-script-inputs
if [ $# -eq 0 ];
then
echo "$0: No arguments. Here's a list of valid inputs:"
echo "./run install"
echo "./run build"
echo "./run test"
echo "./run URL_FILE"
exit 1
elif [ $# -gt 1 ];
then
echo "$0: Too many arguments: $@"
exit 1
else
if [[ $1 == "install" ]];
then
pip install PyGithub
pip install bs4
pip install requests
pip install gitpython
npm install
exit 0
elif [[ $1 == "build" ]];
then
tsc
exit 0
elif [[ $1 == "test" ]];
then
python3 test.py
exit 0
elif [[ $1 == "ltest" ]];
then
python3 licensetest.py
rm -rf nodist/
exit 0
else
isFile=$(file -0 "$1")
case "$isFile" in
(*text*)
node dist/rate/hello-world.js $1
exit 0
;;
(*)
echo "Invalid Input. Here's a list of valid inputs:"
echo "./run install"
echo "./run build"
echo "./run test"
echo "./run URL_FILE"
exit 1
;;
esac
fi
fi