BlueGit

blue-star speeltuin

Files

speeltuin / src / build.sh

build.sh

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