Skip to content

Instantly share code, notes, and snippets.

@reorx
Forked from jkeyes/gist:1242040
Created March 14, 2012 03:40
Show Gist options
  • Save reorx/2033857 to your computer and use it in GitHub Desktop.
Save reorx/2033857 to your computer and use it in GitHub Desktop.
Compile LESS files when a save is detected
#!/bin/bash
watchmedo shell-command --patterns="*.less" --command=\
'LESS=`echo "${watch_src_path}" | sed s/.less/.css/`; \
echo compile: "${watch_src_path}";\
lessc "${watch_src_path}" "${LESS}"; \
if [ "$?" -eq "0" ]; then echo wrote: "${LESS}"; fi' $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment