-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·60 lines (53 loc) · 1.35 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·60 lines (53 loc) · 1.35 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
set -e
st="${1:-1}"
fn="${2:-5}"
overwrite="$3"
if [[ $st -le 1 ]] && [[ $fn -ge 1 ]]; then
echo "1. Installing npm packages..."
if [ -n "$overwrite" ] || [ ! -d "node_modules" ]; then
npm install
else
echo " skip"
fi
fi
if [[ $st -le 2 ]] && [[ $fn -ge 2 ]]; then
echo "2. Downloading cli binary..."
if [ ! -f "codeql.zip" ]; then
url="https://github.com/github/codeql-cli-binaries/releases/download/v2.8.0/codeql.zip"
wget -O codeql.zip $url
else
echo " skip"
fi
fi
if [[ $st -le 3 ]] && [[ $fn -ge 3 ]]; then
echo "3. Unzipping cli binary..."
if [ -n "$overwrite" ] || [ ! -d "cli" ]; then
unzip -q codeql.zip
rm -rf cli
mv codeql cli
cp -r resource/jni cli/jni
cp -r resource/cpython cli/cpython
else
echo " skip"
fi
fi
if [[ $st -le 4 ]] && [[ $fn -ge 4 ]]; then
echo "4. Rewriting library and dbschemes..."
if [ -n "$overwrite" ] || [ ! -d "lib-jni/cpp" ]; then
node rewrite-lib.js
node rewrite-dbscheme.js
( cd lib-jni ; ./patch.sh )
( cd lib-cpython ; ./patch.sh )
else
echo " skip"
fi
fi
if [[ $st -le 5 ]] && [[ $fn -ge 5 ]]; then
echo "5. Lifting dataflow modules..."
if [ -n "$overwrite" ] || [ ! -f "lib-jni/dataflow/DataFlowMerged.qll" ]; then
( cd lib-jni ; ./autofill.sh )
( cd lib-cpython ; ./autofill.sh )
else
echo " skip"
fi
fi