Upload files to "/"

This commit is contained in:
xomf 2024-08-17 21:30:20 +00:00
parent ea616b55cc
commit 66aaaefa63

31
build.sh Normal file
View File

@ -0,0 +1,31 @@
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