-
Notifications
You must be signed in to change notification settings - Fork 0
/
remove_bloated_dependencies.sh
47 lines (38 loc) · 1.17 KB
/
remove_bloated_dependencies.sh
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
jsonlist=$(jq -r '.projects' "repos.json")
for row in $(echo "${jsonlist}" | jq -r '.[] | @base64')
do
_jq()
{
echo ${row} | base64 --decode | jq -r ${1}
}
repoUrl=$(_jq '.gitURL')
entryFile=$(_jq '.entryFile')
projectName=$(_jq '.folder')
folderPath="Playground/"$(_jq '.folder')
testFolder="TestAfterRemove/"$(_jq '.folder')
unitTest=$(_jq '.unitTest')
echo "I am package "$folderPath
# analyzer_output="True"
# while [ "$analyzer_output" = "True" ]
# do
mkdir $testFolder
git clone $repoUrl $testFolder
cd $testFolder
# cp "../../Playground/${projectName}/package-lock.json" ./
# npm ci
npm install
file="../../Playground/"$projectName"/unreachable_runtime_deps_os.txt"
mapfile -t lines < "$file"
for line in "${lines[@]}"; do
echo $line
rm -rf $line
done
npm run $unitTest
# npm run $unitTest >> ../../test_log.txt
cd ../..
# analyzer_output=$(python3 analyze_test_log.py $projectName)
# echo $analyzer_output
# rm -rf $testFolder
# echo -n "" > test_log.txt
# done
done