Browse Source

adapt develop script for makefile

main
Milan 4 weeks ago
parent
commit
1bf3fdf0bc
Signed by: petabyteboy GPG Key ID: A6DC6A7CB0B97859
1 changed files with 8 additions and 7 deletions
  1. +8
    -7
      develop.sh

+ 8
- 7
develop.sh View File

@ -1,19 +1,20 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p inotify-tools pandoc
#!nix-shell -i bash -p gnumake inotify-tools pandoc php
cd "$(dirname "$0")"
inotifywait -qrm --event modify --format '%f' $PWD | (
make
make start
trap "make stop;" EXIT
inotifywait -qrm -e modify -e create -e move -e delete --format '%w%f' $PWD | grep --line-buffered -v 'public\|.swp$\|~$' | (
while true
do
timeout 1 cat /dev/stdin | sort -u
done | \
while read l
do
echo $l changed
set -x
echo $l | grep '\.md$' && pandoc --standalone --template template.html $l > $1/$(basename -s .md $l).html
echo $l | grep '\.jpg$\|\.css$' && cp $l $1/$l
set +x
echo files changed: $l
make
done
)

Loading…
Cancel
Save