Created
December 27, 2015 20:14
-
-
Save tobyontour/c970839cf0b5a5e037d2 to your computer and use it in GitHub Desktop.
Update a css file from a less file in a loop
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
| #!/bin/bash | |
| if [ ! -f "$1" -o ! -f "$2" ] | |
| then | |
| echo "Run with $0 src.less dest.css" | |
| exit 1 | |
| fi | |
| if [ ${1: -5} != ".less" -o ${2: -4} != ".css" ] | |
| then | |
| echo "Run with $0 src.less dest.css" | |
| exit 1 | |
| fi | |
| while true | |
| do | |
| if [ "$1" -nt "$2" ] | |
| then | |
| lessc "$1" > "$2" | |
| echo -n "." | |
| fi | |
| sleep 1 | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment