corysama a day ago I was hoping to stare into the mouth of madness, but I can't find the github repo... LargoLasskhyfv 16 hours ago It says Here's the full script for completeness, in case anyone else wants to use it for some strange reason:> #!/bin/bash set -euxo pipefail DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" cd "$DIR" # Treat as c source file: -x c # Don't output line markers: -P # Don't search system include path: -nostdinc # Remove some predefined macros: -undef my_cpp() { cpp -x c -P -nostdinc -finput-charset=utf8 -undef $@ } # generates a header that undefines all the remaining predefined macros my_cpp -dM - </dev/null | awk '{ print "#undef",$2; }' > /tmp/wheybags_com_undef.h generate_page() { local path path="$(echo $1 | sed 's/^site\/tmp\/pages\///')" echo $path local parent_dir parent_dir="$(dirname "$path")" mkdir -p "site/$parent_dir" my_cpp -I site/tmp -include /tmp/wheybags_com_undef.h "site/tmp/pages/$path" > "site/$path" 2>/dev/null } export -f generate_page export -f my_cpp rm -rf site/* || true mkdir -p site/tmp cp -r pages site/tmp/pages cp -r template site/tmp/template find site/ -type f -exec sed -i 's/\/\//DOUBLE_SLASH_COMMENT_FIX/g' {} \; find site/tmp/pages -type f -exec bash -c 'generate_page "$0"' {} \; rm -rf site/tmp find site/ -type f -exec sed -i 's/DOUBLE_SLASH_COMMENT_FIX/\/\//g' {} \; cp -r assets site/assets cp favicon.ico site/favicon.ico
LargoLasskhyfv 16 hours ago It says Here's the full script for completeness, in case anyone else wants to use it for some strange reason:> #!/bin/bash set -euxo pipefail DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" cd "$DIR" # Treat as c source file: -x c # Don't output line markers: -P # Don't search system include path: -nostdinc # Remove some predefined macros: -undef my_cpp() { cpp -x c -P -nostdinc -finput-charset=utf8 -undef $@ } # generates a header that undefines all the remaining predefined macros my_cpp -dM - </dev/null | awk '{ print "#undef",$2; }' > /tmp/wheybags_com_undef.h generate_page() { local path path="$(echo $1 | sed 's/^site\/tmp\/pages\///')" echo $path local parent_dir parent_dir="$(dirname "$path")" mkdir -p "site/$parent_dir" my_cpp -I site/tmp -include /tmp/wheybags_com_undef.h "site/tmp/pages/$path" > "site/$path" 2>/dev/null } export -f generate_page export -f my_cpp rm -rf site/* || true mkdir -p site/tmp cp -r pages site/tmp/pages cp -r template site/tmp/template find site/ -type f -exec sed -i 's/\/\//DOUBLE_SLASH_COMMENT_FIX/g' {} \; find site/tmp/pages -type f -exec bash -c 'generate_page "$0"' {} \; rm -rf site/tmp find site/ -type f -exec sed -i 's/DOUBLE_SLASH_COMMENT_FIX/\/\//g' {} \; cp -r assets site/assets cp favicon.ico site/favicon.ico
I was hoping to stare into the mouth of madness, but I can't find the github repo...
It says Here's the full script for completeness, in case anyone else wants to use it for some strange reason:
> #!/bin/bash set -euxo pipefail DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" cd "$DIR" # Treat as c source file: -x c # Don't output line markers: -P # Don't search system include path: -nostdinc # Remove some predefined macros: -undef my_cpp() { cpp -x c -P -nostdinc -finput-charset=utf8 -undef $@ } # generates a header that undefines all the remaining predefined macros my_cpp -dM - </dev/null | awk '{ print "#undef",$2; }' > /tmp/wheybags_com_undef.h generate_page() { local path path="$(echo $1 | sed 's/^site\/tmp\/pages\///')" echo $path local parent_dir parent_dir="$(dirname "$path")" mkdir -p "site/$parent_dir" my_cpp -I site/tmp -include /tmp/wheybags_com_undef.h "site/tmp/pages/$path" > "site/$path" 2>/dev/null } export -f generate_page export -f my_cpp rm -rf site/* || true mkdir -p site/tmp cp -r pages site/tmp/pages cp -r template site/tmp/template find site/ -type f -exec sed -i 's/\/\//DOUBLE_SLASH_COMMENT_FIX/g' {} \; find site/tmp/pages -type f -exec bash -c 'generate_page "$0"' {} \; rm -rf site/tmp find site/ -type f -exec sed -i 's/DOUBLE_SLASH_COMMENT_FIX/\/\//g' {} \; cp -r assets site/assets cp favicon.ico site/favicon.ico