Skip to content

Instantly share code, notes, and snippets.

@kumarbhushan
Forked from abhihebbar/lesstocss.sh
Last active April 11, 2019 00:54
Show Gist options
  • Save kumarbhushan/67c801062765f19da9cd3f9d96e5524a to your computer and use it in GitHub Desktop.
Save kumarbhushan/67c801062765f19da9cd3f9d96e5524a to your computer and use it in GitHub Desktop.
Compile all LESS files to CSS in a directory (Recursive).
//for Linus
#!/bin/bash
for lessfile in $(find -name "*.less"); do
cssfile=$(echo $lessfile | sed 's/\.less$/.css/i')
echo "Comiling $lessfile to $cssfile";
rm -f $cssfile;
lessc $lessfile > $cssfile;
done;
//for macOS
#!/bin/bash
for lessfile in $(find . -name "*.less"); do
cssfile=${lessfile//.less/.css}
echo "Comiling $lessfile to $cssfile";
rm -f $cssfile;
lessc $lessfile > $cssfile;
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment