Skip to content

Instantly share code, notes, and snippets.

@jwarby
Last active August 29, 2015 14:01
Show Gist options
  • Save jwarby/f7dfdd95d56b37121faf to your computer and use it in GitHub Desktop.
Save jwarby/f7dfdd95d56b37121faf to your computer and use it in GitHub Desktop.
Recompile all LESS files in a specified directory
#! /bin/bash
#
# Recompiles all LESS files found (recursively) in the specified directory, e.g.
#
# [someome /public/css]$ recompile-less .
# or
# [someone /myapp]$ recompile-less public/css
find "$1" -name '*.less' | while read line; do
echo "Recompiling $line..."
REPLACE=`echo $line | sed "s|\.less|\.css|"`
(lessc "$line" "$REPLACE" &)
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment