aboutsummaryrefslogtreecommitdiff
path: root/vendors/lessphp/tests/bootstrap.sh
diff options
context:
space:
mode:
Diffstat (limited to 'vendors/lessphp/tests/bootstrap.sh')
-rwxr-xr-xvendors/lessphp/tests/bootstrap.sh49
1 files changed, 49 insertions, 0 deletions
diff --git a/vendors/lessphp/tests/bootstrap.sh b/vendors/lessphp/tests/bootstrap.sh
new file mode 100755
index 000000000..b49f7cec3
--- /dev/null
+++ b/vendors/lessphp/tests/bootstrap.sh
@@ -0,0 +1,49 @@
+echo "This script clones twitter bootsrap, compiles it with lessc and lessphp,"
+echo "cleans up results with csstidy, and outputs diff. To run it, you need to"
+echo "have git, csstidy and lessc installed."
+echo ""
+
+csstidy_params="--allow_html_in_templates=false --compress_colors=false
+--compress_font-weight=false --discard_invalid_properties=false
+--lowercase_s=false --preserve_css=true --remove_bslash=false
+--remove_last_;=false --sort-properties=true --sort-selectors=true
+--timestamp=false --silent=true --merge_selectors=0 --case-properties=0
+--optimize-shorthands=0 --template=high"
+
+if [ -z "$@" ]; then
+ diff_tool="diff -b -u -t -B"
+else
+ diff_tool=$@
+fi
+
+mkdir -p tmp
+
+if [ ! -d 'bootstrap/' ]; then
+ echo ">> Cloning bootstrap to bootstrap/"
+ git clone https://github.com/twitter/bootstrap
+fi
+
+echo ">> Lessc compilation"
+lessc bootstrap/less/bootstrap.less tmp/bootstrap.lessc.css
+
+echo ">> Lessphp compilation"
+../plessc bootstrap/less/bootstrap.less tmp/bootstrap.lessphp.css
+echo ">> Cleanup and convert"
+
+# csstidy tmp/bootstrap.lessc.css $csstidy_params tmp/bootstrap.lessc.clean.css
+# csstidy tmp/bootstrap.lessphp.css $csstidy_params tmp/bootstrap.lessphp.clean.css
+#
+# # put a newline after { and :
+# function split() {
+# sed 's/\(;\|{\)/\1\n/g'
+# }
+#
+# # csstidy is messed up and wont output to stdout when there are a bunch of options
+# cat tmp/bootstrap.lessc.clean.css | split | tee tmp/bootstrap.lessc.clean.css
+# cat tmp/bootstrap.lessphp.clean.css | split | tee tmp/bootstrap.lessphp.clean.css
+
+php sort.php tmp/bootstrap.lessc.css > tmp/bootstrap.lessc.clean.css
+php sort.php tmp/bootstrap.lessphp.css > tmp/bootstrap.lessphp.clean.css
+
+echo ">> Doing diff"
+$diff_tool tmp/bootstrap.lessc.clean.css tmp/bootstrap.lessphp.clean.css