From 6599236325b1db3d57bb0428fd97affa4caaaf0e Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Mon, 28 Apr 2014 13:04:03 +0200 Subject: Add new script localikiwatchstyling. --- localikiwatchstyling | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 localikiwatchstyling diff --git a/localikiwatchstyling b/localikiwatchstyling new file mode 100755 index 0000000..9ecb305 --- /dev/null +++ b/localikiwatchstyling @@ -0,0 +1,25 @@ +#!/bin/sh +# +# /usr/local/bin/localikiwatchstyling +# Copyright 2014 Jonas Smedegaard +# +# 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" -- cgit v1.2.3