Created
February 4, 2017 17:28
-
-
Save rvause/eedc577769bbf12a641ff20f822ffbf3 to your computer and use it in GitHub Desktop.
Simple alternative to using gulp/grunt to build CSS using Less
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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