32 lines
785 B
Bash
32 lines
785 B
Bash
|
SRC_DIR="./src"
|
||
|
BUILD_DIR="./build"
|
||
|
OUTPUT_FILE="$BUILD_DIR/startup.lua"
|
||
|
BOOT_FILE="$SRC_DIR/boot.lua"
|
||
|
MAIN_FILE="$SRC_DIR/main.lua"
|
||
|
|
||
|
mkdir -p "$BUILD_DIR"
|
||
|
|
||
|
> "$OUTPUT_FILE"
|
||
|
|
||
|
|
||
|
if [ -e "$BOOT_FILE" ]; then
|
||
|
echo "-- File: boot.lua" >> "$OUTPUT_FILE"
|
||
|
cat "$BOOT_FILE" >> "$OUTPUT_FILE"
|
||
|
echo >> "$OUTPUT_FILE"
|
||
|
fi
|
||
|
|
||
|
for file in "$SRC_DIR"/*.lua; do
|
||
|
if [ -e "$file" ] && [ "$(basename "$file")" != "boot.lua" ] && [ "$(basename "$file")" != "main.lua" ]; then
|
||
|
filename=$(basename "$file")
|
||
|
echo "-- File: $filename" >> "$OUTPUT_FILE"
|
||
|
cat "$file" >> "$OUTPUT_FILE"
|
||
|
echo >> "$OUTPUT_FILE"
|
||
|
fi
|
||
|
done
|
||
|
|
||
|
if [ -e "$MAIN_FILE" ]; then
|
||
|
echo "-- File: main.lua" >> "$OUTPUT_FILE"
|
||
|
cat "$MAIN_FILE" >> "$OUTPUT_FILE"
|
||
|
echo >> "$OUTPUT_FILE"
|
||
|
fi
|