Skip to content

Instantly share code, notes, and snippets.

@tobyontour
Created December 27, 2015 20:14
Show Gist options
  • Select an option

  • Save tobyontour/c970839cf0b5a5e037d2 to your computer and use it in GitHub Desktop.

Select an option

Save tobyontour/c970839cf0b5a5e037d2 to your computer and use it in GitHub Desktop.
Update a css file from a less file in a loop
#!/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