BlueGit

blue-star speeltuin

Files

speeltuin / src / build.sh

build.sh

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