-
Notifications
You must be signed in to change notification settings - Fork 258
/
buildpackage.sh
executable file
·53 lines (40 loc) · 1.14 KB
/
buildpackage.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
#!/usr/bin/env bash
CURRENTDIR=`pwd`
SLIMERDIR=`dirname $0`
SLIMERDIR=`cd $SLIMERDIR;pwd`
cd $SLIMERDIR
VERSION=`grep "^Version=" src/application.ini`
VERSION=${VERSION:8}
TARGETDIR="$SLIMERDIR/_dist/slimerjs-$VERSION"
if [ -d "$TARGETDIR" ]
then
rm -rf $TARGETDIR/*
else
mkdir -p "$TARGETDIR"
fi
# copy files
cd src
cp application.ini $TARGETDIR
cp slimerjs $TARGETDIR
cp slimerjs.bat $TARGETDIR
cp slimerjs.py $TARGETDIR
cp LICENSE $TARGETDIR
cp README.md $TARGETDIR
cp slimerjs-node $TARGETDIR
cp phantom-protocol.js $TARGETDIR
mkdir -p $TARGETDIR/chrome/
cp -a chrome/icons $TARGETDIR/chrome/
cp -a vendors $TARGETDIR/
# zip chrome files into omni.ja
zip -r $TARGETDIR/omni.ja chrome/ components/ defaults/ modules/ chrome.manifest --exclude @package_exclude.lst
# set the build date
cd $TARGETDIR
BUILDDATE=`date +%Y%m%d`
sed -i -e "s/BuildID=.*/BuildID=$BUILDDATE/g" application.ini
# create the final package
cd $SLIMERDIR/_dist
zip -r "slimerjs-$VERSION.zip" "slimerjs-$VERSION"
tar cjf "slimerjs-$VERSION.tar.bz2" "slimerjs-$VERSION"
cd $CURRENTDIR
echo ""
echo "slimerjs-$VERSION.zip and slimerjs-$VERSION.tar.bz2 are in $SLIMERDIR/_dist/"