-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·57 lines (42 loc) · 1.09 KB
/
build.sh
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
ORIG_PWD=`pwd`
BASEDIR=`dirname $0`
cd $BASEDIR
BASEDIR=`pwd`
TMP_DIR=$BASEDIR/tmp
VERSION=$1
print_usage_and_quit()
{
echo $2
echo "USAGE: $1 <version>"
exit 1
}
if [ "$VERSION" = "" ]; then
print_usage_and_quit $0 "Version must be specified"
fi
VERSIONED_DIR="$BASEDIR/prepared/$VERSION"
rm -fR "$VERSIONED_DIR"
echo "Creating directories at $VERSIONED_DIR/..."
mkdir -p "$VERSIONED_DIR"
echo "Copying image and style files..."
cp -R "$BASEDIR/common" "$VERSIONED_DIR/common/"
cp -R "$BASEDIR/openclass" "$VERSIONED_DIR/openclass/"
cp -R "$BASEDIR/appStyles" "$VERSIONED_DIR/appStyles/"
cd $BASEDIR
chmod -R 755 "$VERSIONED_DIR/openclass/"*
chmod -R 755 "$VERSIONED_DIR/common/"*
chmod -R 755 "$VERSIONED_DIR/appStyles/"*
echo "Removing .less files..."
cd "$VERSIONED_DIR/openclass"
rm -f *".less"
cd "$VERSIONED_DIR/openclass/form"
rm -f *".less"
cd "$VERSIONED_DIR/openclass/layout"
rm -f *".less"
cd "$BASEDIR"
node CSS_compress.js "$VERSIONED_DIR"
echo "Setting version $VERSION in version.txt..."
echo $VERSION > version.txt
cd "$ORIG_PWD"
echo "CSS Build Done."
cd $ORIG_PWD