Skip to content

Instantly share code, notes, and snippets.

View GOshaSaveiko's full-sized avatar

GOsha GOshaSaveiko

  • Innovatica
  • Brest
View GitHub Profile
@GOshaSaveiko
GOshaSaveiko / autocompile.sh
Last active December 15, 2015 02:48
LESS autocompile bash script
#!/bin/bash
echo "Start watching... Cancel -> Ctrl + C";
while true; do
#fullname=`find -name "*.less"`; #all files need to be compiled
#fullname=`cat watchlist`; #only in watchlist
fullname=`grep -H -m 1 "^/\*@autocompile\*/" *.less | cut -d: -f1`; #only with autocompile instructions
inotifywait -qe modify $fullname;
for fn in $fullname; do
filename="$(basename ${fn})";
path="$(dirname $fn)";