1 minute to read
autobuildSite
About This Task
This script starts an endless loop which checks for changes to your docs source then re-runs the generateSite
-task whenever it detects changes.
The output will be logged to build/generateSite.log
.
Source
bin/autobuildSite.bash
#!/bin/bash
DIR_TO_WATCH='src/'
#COMMAND='rm -r build || true && mkdir -p build/microsite/output/images/ && ./dtcw generateSite 2>&1 | tee build/generateSite.log'
COMMAND='mkdir -p build/microsite/output/images/ && ./dtcw generateSite 2>&1 | tee build/generateSite.log'
#execute first time
cp src/docs/images/ready.png build/microsite/output/images/status.png
#eval $COMMAND
#wait for changes and execute
while true ; do
watch --no-title --chgexit "ls -lR ${DIR_TO_WATCH} | sha1sum"
cp src/docs/images/building.png build/microsite/output/images/status.png
eval "$COMMAND"
cp src/docs/images/ready.png build/microsite/output/images/status.png
sleep 6
done
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.