-
Notifications
You must be signed in to change notification settings - Fork 47
/
l2c
executable file
·42 lines (39 loc) · 947 Bytes
/
l2c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# l2c
#
# Purpose:
# Compile *.less to *.css
#
#Copyright (C) 2012 Potix Corporation. All Rights Reserved.
#
cssdir=$0
cssdir=${cssdir%/*}
if [ "$cssdir" = "." ] ; then
cssdir=".."
elif [ "$cssdir" = "${cssdir%/*}" ] ; then
cssdir="."
else
cssdir=${cssdir%/*}
fi
if [ "$TERM" = "cygwin" ] || [ "$OSTYPE" = "cygwin" ] ; then
cssdir=$(cygpath -u $cssdir)
fi
jarfl=$cssdir/tool/lib/lesscss-engine-1.3.0-cli.jar
if [ ! -f $jarfl ] ; then
echo $jarfl not found
exit 1
fi
if [ ! -d $cssdir/lib/css ] ; then
echo $cssdir/lib/css not found
fi
for f in $cssdir/lib/css/*/*.less; do
echo Compile $f
dstfl=${f%.less}.css
java -jar $jarfl $f ${dstfl}.tmp
echo "/* DO NOT EDIT" > $dstfl
echo " * Auto-generated" >> $dstfl #not to generate timestamp to avoid redundant commits
echo " * Copyright (C) 2012 Potix Corporation. All Rights Reserved." >> $dstfl
echo " */" >> $dstfl
cat ${dstfl}.tmp >> $dstfl
rm ${dstfl}.tmp
done