add and document more build options
This commit is contained in:
parent
eb1ab2eddf
commit
facd2dd570
2 changed files with 34 additions and 2 deletions
14
README.md
14
README.md
|
@ -18,6 +18,20 @@ Eureka also parses a [twtxt](https://twtxt.readthedocs.io/en/latest/) file at `S
|
||||||
6. Edit your `inc/meta.nav.htm` again to reference your new page.
|
6. Edit your `inc/meta.nav.htm` again to reference your new page.
|
||||||
7. Run `./build.sh` again! You will be warned of any orphaned files.
|
7. Run `./build.sh` again! You will be warned of any orphaned files.
|
||||||
|
|
||||||
|
## build options
|
||||||
|
|
||||||
|
Currently these build options are supported, and they must be supplied __in this order__ if used together:
|
||||||
|
- `-r`: Regenerate all thumbnails
|
||||||
|
- `-d`: Delete the latest twtxt entry; if used together with `-t`, the new entry replaces the old one
|
||||||
|
- `-t`: Add the next arg (quoted string) as a twtxt entry
|
||||||
|
|
||||||
|
Combined argument format like `./build.sh -rdt "twt stuff"` is not supported. Use this format instead:
|
||||||
|
```
|
||||||
|
./build.sh -r -d -t "twt stuff"
|
||||||
|
```
|
||||||
|
|
||||||
|
## debugging
|
||||||
|
|
||||||
If you run into issues with your markup crashing `eureka`, edit the `build.sh` file to uncomment the linux debug build line and comment the fast build; this will show you a stack trace of where you are running into buffer overflows, and give you a hint of where your markup is messed up. To see the individual file that has the error, also uncomment the line in `fpinject()` that prints the file names.
|
If you run into issues with your markup crashing `eureka`, edit the `build.sh` file to uncomment the linux debug build line and comment the fast build; this will show you a stack trace of where you are running into buffer overflows, and give you a hint of where your markup is messed up. To see the individual file that has the error, also uncomment the line in `fpinject()` that prints the file names.
|
||||||
|
|
||||||
# markup
|
# markup
|
||||||
|
|
18
build.sh
18
build.sh
|
@ -41,15 +41,33 @@ cc main.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -o main
|
||||||
# echo "$(du -b ./main | cut -f1) bytes written"
|
# echo "$(du -b ./main | cut -f1) bytes written"
|
||||||
|
|
||||||
# Run
|
# Run
|
||||||
|
if [ "$1" = "-r" ]; then
|
||||||
|
regen="true"
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
if [ "$1" = "-d" ]; then
|
||||||
|
shift
|
||||||
|
tmptwtxt=$(mktemp)
|
||||||
|
tail -n +2 ../www/twtxt.txt > ${tmptwtxt}
|
||||||
|
cp ${tmptwtxt} ../www/twtxt.txt
|
||||||
|
rm ${tmptwtxt}
|
||||||
|
echo "Deleted latest twtxt"
|
||||||
|
fi
|
||||||
if [ "$1" = "-t" ]; then
|
if [ "$1" = "-t" ]; then
|
||||||
shift && ./tw.sh $@
|
shift && ./tw.sh $@
|
||||||
|
echo "Twtxt added"
|
||||||
fi
|
fi
|
||||||
./main
|
./main
|
||||||
exitstatus=$?
|
exitstatus=$?
|
||||||
if [ "${exitstatus}" = "0" ]; then
|
if [ "${exitstatus}" = "0" ]; then
|
||||||
|
if [ "${regen}" = "true" ]; then
|
||||||
|
echo "Clearing thumbnails and regenerating in the background"
|
||||||
|
(./thumbnailer.sh clean > /dev/null 2>&1; ./thumbnailer.sh build > /dev/null 2>&1) &
|
||||||
|
else
|
||||||
echo "Generating thumbnails in the background"
|
echo "Generating thumbnails in the background"
|
||||||
(./thumbnailer.sh build > /dev/null 2>&1) &
|
(./thumbnailer.sh build > /dev/null 2>&1) &
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
rm -f ./main
|
rm -f ./main
|
||||||
|
|
Loading…
Reference in a new issue