Refactored to use a build script

This commit is contained in:
2025-07-13 14:59:46 -04:00
parent fe4b3c3e1b
commit eeb611b7af
7 changed files with 383 additions and 330 deletions

35
bin/build Executable file
View File

@ -0,0 +1,35 @@
#!/bin/bash
set +e
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
cd "$DIR/.."
# Build script to combine all source files into a single content.js
# Create the output file and start the IIFE
echo '(function() {' >content.js
echo '' >>content.js
# Add each external library first
for file in lib/*; do
cat "$file" >>content.js
echo "// === $file ===" >>content.js
echo '' >>content.js
echo '' >>content.js
done
# Add each source file in order
for file in src/*; do
echo "// === $file ===" >>content.js
cat "$file" >>content.js
echo '' >>content.js
echo '' >>content.js
done
echo 'main();' >>content.js
# Close the IIFE
echo '})();' >>content.js
echo "Built content.js from source files"