Skip to content

Instantly share code, notes, and snippets.

@rvause
Created February 4, 2017 17:28
Show Gist options
  • Select an option

  • Save rvause/eedc577769bbf12a641ff20f822ffbf3 to your computer and use it in GitHub Desktop.

Select an option

Save rvause/eedc577769bbf12a641ff20f822ffbf3 to your computer and use it in GitHub Desktop.
Simple alternative to using gulp/grunt to build CSS using Less
#!/usr/bin/env bash
function css_build {
echo "Starting build..."
lessc --verbose ./less/main.less ../assets/css/app.css
echo "Completed at `date +%H:%I:%S`"
}
function css_watch {
echo "Building CSS on changes (CTRL+C to stop)"
while true
do
css_build
inotifywait -e modify -e move -e create -e delete -r less > /dev/null 2>&1
done
}
if [[ $1 == "build" ]];
then
css_build
else
css_watch
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment