aboutsummaryrefslogtreecommitdiff
path: root/mod/less/vendors/lessphp/tests/bootstrap.sh
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-03-15 14:42:42 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-03-15 14:42:42 -0300
commit711dab09b5146e74dbeda56679c65e3b6bec71f3 (patch)
treefed51be1475322c7a565d180d0b0ae3f97e6cf3a /mod/less/vendors/lessphp/tests/bootstrap.sh
parent4311cd55c6e6d6a064bfeabb53b9c528ca553ffd (diff)
parent551497ef94f6239b109316d8fab32f0909b13f73 (diff)
downloadelgg-711dab09b5146e74dbeda56679c65e3b6bec71f3.tar.gz
elgg-711dab09b5146e74dbeda56679c65e3b6bec71f3.tar.bz2
Merge commit '551497ef94f6239b109316d8fab32f0909b13f73' as 'mod/less'
Diffstat (limited to 'mod/less/vendors/lessphp/tests/bootstrap.sh')
-rwxr-xr-xmod/less/vendors/lessphp/tests/bootstrap.sh49
1 files changed, 49 insertions, 0 deletions
diff --git a/mod/less/vendors/lessphp/tests/bootstrap.sh b/mod/less/vendors/lessphp/tests/bootstrap.sh
new file mode 100755
index 000000000..b49f7cec3
--- /dev/null
+++ b/mod/less/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