Skip to content

Instantly share code, notes, and snippets.

@timtan
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save timtan/d49a8b24785c1fe8dff9 to your computer and use it in GitHub Desktop.

Select an option

Save timtan/d49a8b24785c1fe8dff9 to your computer and use it in GitHub Desktop.
A Simple Makefile to make you develop less happily
// Build Your Less with watch function
// you need to do the following first
// sudo pip install watchdog
LESS_FILE=style/style.less
TARGET=style/style.css
INCLUDE=--include-path=dist-bootstrap/less
less_command := lessc $(LESS_FILE) $(INCLUDE) $(TARGET)
notification_detected := echo modification detected
shell_command := $(notification_detected);$(less_command)
watchmedo_option := shell-command --recursive --patterns="*.less"
compile:
$(less_command)
watch:
watchmedo $(watchmedo_option) --command='$(shell_command)'
@timtan
Copy link
Copy Markdown
Author

timtan commented Sep 4, 2014

less css didn't have watch mode.

to use the Makefile, you need to pip install watchdog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment