This repository has been archived by the owner on Feb 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
package.sh
executable file
·61 lines (52 loc) · 2.85 KB
/
package.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
58
59
60
61
#!/bin/sh
#Script for create the plugin artifact
echo "Travis tag: $TRAVIS_TAG"
if [ "$TRAVIS_TAG" = "" ]
then
TRAVIS_TAG='1.0.0'
fi
SRC_DIR="webpay"
FILE1="webpay.php"
FILE2="config.xml"
FILE3="config_es.xml"
cd $SRC_DIR
composer install --no-dev
composer update --no-dev
cd ..
sed -i.bkp "s/$this->version = '3.0.6'/$this->version = '${TRAVIS_TAG#"v"}'/g" "$SRC_DIR/$FILE1"
sed -i.bkp "s/\[3.0.6\]/\[${TRAVIS_TAG#"v"}\]/g" "$SRC_DIR/$FILE2"
sed -i.bkp "s/\[3.0.6\]/\[${TRAVIS_TAG#"v"}\]/g" "$SRC_DIR/$FILE3"
PLUGIN_FILE="plugin-prestashop-webpay-$TRAVIS_TAG.zip"
zip -FSr $PLUGIN_FILE $SRC_DIR -x webpay/vendor/tecnickcom/tcpdf/fonts/a*\/* \
webpay/vendor/tecnickcom/tcpdf/fonts/d*\/* \
webpay/vendor/tecnickcom/tcpdf/fonts/f*\/* \
webpay/vendor/tecnickcom/tcpdf/fonts/a* \
webpay/vendor/tecnickcom/tcpdf/fonts/ci* \
webpay/vendor/tecnickcom/tcpdf/fonts/dejavu-* \
webpay/vendor/tecnickcom/tcpdf/fonts/dejavusansb* \
webpay/vendor/tecnickcom/tcpdf/fonts/dejavusansc* \
webpay/vendor/tecnickcom/tcpdf/fonts/dejavusanse* \
webpay/vendor/tecnickcom/tcpdf/fonts/dejavusansi* \
webpay/vendor/tecnickcom/tcpdf/fonts/dejavusansm* \
webpay/vendor/tecnickcom/tcpdf/fonts/dejavusans.z \
webpay/vendor/tecnickcom/tcpdf/fonts/dejavuser* \
webpay/vendor/tecnickcom/tcpdf/fonts/f* \
webpay/vendor/tecnickcom/tcpdf/fonts/k* \
webpay/vendor/tecnickcom/tcpdf/fonts/m* \
webpay/vendor/tecnickcom/tcpdf/fonts/p* \
webpay/vendor/tecnickcom/tcpdf/fonts/s* \
webpay/vendor/tecnickcom/tcpdf/fonts/t* \
webpay/vendor/tecnickcom/tcpdf/fonts/u* \
webpay/vendor/tecnickcom/tcpdf/examples/\* \
webpay/vendor/apache/log4php/src/examples/\* \
webpay/vendor/apache/log4php/src/test/\* \
webpay/vendor/apache/log4php/src/site/\* \
"$SRC_DIR/$FILE1.bkp" "$SRC_DIR/$FILE2.bkp" "$SRC_DIR/$FILE3.bkp"
cp "$SRC_DIR/$FILE1.bkp" "$SRC_DIR/$FILE1"
cp "$SRC_DIR/$FILE2.bkp" "$SRC_DIR/$FILE2"
cp "$SRC_DIR/$FILE3.bkp" "$SRC_DIR/$FILE3"
rm "$SRC_DIR/$FILE1.bkp"
rm "$SRC_DIR/$FILE2.bkp"
rm "$SRC_DIR/$FILE3.bkp"
echo "Plugin version: $TRAVIS_TAG"
echo "Plugin file: $PLUGIN_FILE"