Skip to content

Instantly share code, notes, and snippets.

@nicmart
Forked from gbonanome/lesscdir
Last active December 16, 2015 01:09
Show Gist options
  • Save nicmart/5353301 to your computer and use it in GitHub Desktop.
Save nicmart/5353301 to your computer and use it in GitHub Desktop.
#!/bin/bash
# file name: lesscdir
# Compile every .less found under a specified folder
# $1 is the folder to search
# $2 allows to use a lessc parameters for compiling
if [[ -z $1 ]];then
echo 'Specify a directory to search'
exit
fi
find $1 -name '*.less' -print | while read name; do
FROM=$name
TO=$(echo $name | sed "s|\.less|\.css|")
echo 'Compiling' $FROM '->' $TO
lessc $2 $FROM $TO
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment