mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-07-19 12:59:24 +00:00
fixup build.sh script
This commit is contained in:
@@ -1,11 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
for YAML in *.yml; do
|
||||
./markmaker.py < $YAML > $YAML.html || rm $YAML.html
|
||||
done
|
||||
|
||||
if [ "$1" = "watch" ]; then
|
||||
while true; do
|
||||
find . | entr -d $0 && break
|
||||
case "$1" in
|
||||
once)
|
||||
for YAML in *.yml; do
|
||||
./markmaker.py < $YAML > $YAML.html || rm $YAML.html
|
||||
done
|
||||
fi
|
||||
;;
|
||||
|
||||
forever)
|
||||
# There is a weird bug in entr, at least on MacOS,
|
||||
# where it doesn't restore the terminal to a clean
|
||||
# state when exitting. So let's try to work around
|
||||
# it with stty.
|
||||
STTY=$(stty -g)
|
||||
while true; do
|
||||
find . | entr -d $0 once
|
||||
[ $? = 2 ] || break
|
||||
done
|
||||
stty $STTY
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "$0 <once|forever>"
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user