Skip to content

Commit 52ef914

Browse files
committed
removed eventHandler
1 parent fefbf01 commit 52ef914

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

fetch-deps.sh

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ set -e
1010

1111
libs=(
1212
"helperFunctions-lib"
13-
"eventCallStack-lib"
1413
"ccClass-lib"
1514
"testSuite-lib"
1615
)
@@ -23,20 +22,30 @@ targetFolderName=libs
2322

2423
# fetch files.txt and save each file into the targetFolder
2524
fetch() {
26-
2725
files_txt=$(curl -fsSL "https://raw.githubusercontent.com/$repo/$1/$branch/files.txt")
2826
if [ -z "$files_txt" ]; then
2927
echo "Could not load files.txt for $1"
3028
exit 1
3129
fi
3230
while IFS= read -r FILE; do
33-
rm -f $targetFolderName/$1.lua # rm existing file
34-
curl -s "https://raw.githubusercontent.com/$repo/$1/$branch/$FILE" -o "$targetFolderName/$FILE"
31+
url="https://raw.githubusercontent.com/$repo/$1/$branch/$FILE"
32+
33+
mkdir -p "$(dirname "$targetFolderName/$FILE")" # create the folder (and subfolders specified in the files.txt)
34+
rm -f $targetFolderName/$FILE.lua # rm existing file
35+
if ! curl -s -o "$targetFolderName/$FILE" "$url"; then
36+
echo "could not get / write the file $i: '$FILE' to the folder '$targetFolderName'"
37+
exit 1
38+
fi
39+
# echo "saved $1: '$FILE' in '$targetFolderName'"
3540
done < <(echo "$files_txt")
3641
}
3742

38-
mkdir -p $targetFolderName
39-
40-
for i in "${libs[@]}"; do
41-
fetch "$i"
42-
done
43+
if [[ $# -eq 0 ]]; then
44+
# No arguments given, fetch all
45+
for i in "${libs[@]}"; do
46+
fetch "$i"
47+
done
48+
else
49+
# Argument given, fetch arguemt
50+
fetch "$1"
51+
fi

0 commit comments

Comments
 (0)