Skip to content

Instantly share code, notes, and snippets.

@jkeyes
Created September 26, 2011 11:20
Show Gist options
  • Save jkeyes/1242040 to your computer and use it in GitHub Desktop.
Save jkeyes/1242040 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