1
Fork 0
mirror of https://github.com/RGBCube/GCCPreprocessHTML synced 2025-05-31 04:18:12 +00:00
GCCPreprocessHTML/build.sh
2023-05-07 01:07:38 +03:00

19 lines
381 B
Bash
Executable file

#!/bin/sh
function process {
cc -E - < "$1"
}
rm -rf ./build
mkdir ./build
for html_file in $(find -name "*.html"); do
path=./build/${html_file#./}
# Preprocess if filename doesn't start with _.
if [[ $(basename $html_file) != _* ]]; then
echo "Building $html_file..."
mkdir $(dirname $path) 2> /dev/null
sed "/^#/d" <(process $html_file) > $path
fi
done