Refactored to use a build script
This commit is contained in:
35
bin/build
Executable file
35
bin/build
Executable 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"
|
||||
Reference in New Issue
Block a user