blob: 9ecb3052e27657ae27277b7dc94a4f6b6a7d8ba3 (
plain)
- #!/bin/sh
- #
- # /usr/local/bin/localikiwatchstyling
- # Copyright 2014 Jonas Smedegaard <dr@jones.dk>
- #
- # Watch Ikiwiki styling and regenerate when changing
- #
- # Depends: ruby-compass, inotify-hookable
- # Recommends: libnotify-bin
- set -e
- stem=
- if [ -f styling/style.scss ]; then
- stem=style
- elif [ -f styling/local.scss ]; then
- stem=local
- else
- echo "Couldn't locate either style.scss or local.scss in styling dir."
- exit 1
- fi
- set +e
- inotify-hookable -f styling/$stem.scss \
- -c "scss --compass -g styling/$stem.scss:styling/$stem.css && cp styling/$stem.css build/html/$stem.css && if [ -n "$DISPLAY" ] && [ -e /usr/bin/notify-send ]; then notify-send 'CSS updated' 'Ikiwiki $stem.css auto-updated from styling/$stem.scss'; fi"
|