BlueGit

timfa raytracer

Files

raytracer / src / build.sh

build.sh

build.sh 794 B Download Raw
1#!/usr/bin/env bash
2set -euo pipefail
3ROOT="$(cd "$(dirname "$0")/.." && pwd)"
4BUILD_FILE="$ROOT/build/game.js"
5SRC_DIR="$ROOT/src"
6
7printf "Build started, output file: %s\n" "$BUILD_FILE"
8rm -f "$BUILD_FILE"
9
10# Deterministic order (texture helpers before world/player/scene).
11FILES=(
12 "$SRC_DIR/textureColumn.js"
13 "$SRC_DIR/levels.js"
14 "$SRC_DIR/tiles.js"
15 "$SRC_DIR/world.js"
16 "$SRC_DIR/player.js"
17 "$SRC_DIR/raycastScene.js"
18 "$SRC_DIR/main.js"
19)
20
21for file in "${FILES[@]}"
22do
23 if [[ ! -f "$file" ]]
24 then
25 printf "Missing source file: %s\n" "$file" >&2
26 exit 1
27 fi
28 printf "\n/*\n * Start File:\n * %s\n */ \n" "$file" >> "$BUILD_FILE"
29 printf "Building %s\n" "$file"
30 cat "$file" >> "$BUILD_FILE"
31 printf "\n/*\n * End File:\n * %s\n */ \n" "$file" >> "$BUILD_FILE"
32done
33printf "DONE\n"