BlueGit

blue-star speeltuin

Files

speeltuin / src / build.sh

build.sh

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