BlueGit

blue-star speeltuin

Files

speeltuin / src / build.sh

build.sh

build.sh 600 B Download Raw
1BUILD_FILE="./build/game.js"
2SRC_DIR="./src"
3
4printf "Build started, output file: $BUILD_FILE\n"
5
6if test -f "$BUILD_FILE"; then
7 unlink $BUILD_FILE
8fi
9
10loop()
11{
12 shopt -s nullglob
13 shopt -s globstar
14
15 for file in "$@"/**
16 do
17 if [[ -f "$file" && "${file##*.}" = "js" ]]
18 then
19 printf "\n/*\n * Start File:\n * "$file"\n */ \n" >> "$BUILD_FILE";
20 printf "Building "$file"\n";
21 cat "$file" >> "$BUILD_FILE";
22 printf "\n/*\n * End File:\n * "$file"\n */ \n" >> "$BUILD_FILE";
23 fi
24 done
25}
26loop $SRC_DIR
27printf "DONE"