Skip to content

Instantly share code, notes, and snippets.

@judepereira
Last active February 4, 2016 19:45
Show Gist options
  • Save judepereira/99df70350156c54ff3fd to your computer and use it in GitHub Desktop.
Save judepereira/99df70350156c54ff3fd to your computer and use it in GitHub Desktop.
A helper to re-compile LESS into CSS for an exploded WAR deployment in IntelliJ IDEA
#!/bin/bash
exploded_artifact_path=/Users/jude/developer/WizRocket/out/artifacts/Dashboard_war_exploded
less=/usr/local/bin/lessc
function update {
target=`echo $1 | sed s/web\\// | sed s/.less/.css/`
echo "Generating $exploded_artifact_path/$target"
$less $1 $exploded_artifact_path/$target
}
function all {
find $exploded_artifact_path -name *.less | while read path; do
output=`echo $path | sed s/.less/.css/`
echo "Generating $output"
$less $path $output
done
}
$1 $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment