forked from KiranBali/wordpress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpack-plugin.sh
executable file
·43 lines (32 loc) · 891 Bytes
/
pack-plugin.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
#!/bin/bash
NAME="yoti-connect-1.0.0-edge.zip"
SDK_RELATIVE_PATH="sdk"
curl https://github.com/getyoti/php/archive/master.zip -O -L
unzip master.zip -d sdk
mv sdk/php-master/src/* sdk
rm -rf sdk/php-master
if [ ! -d "./yoti-connect" ]; then
echo "ERROR: Must be in directory containing ./yoti-connect folder"
exit
fi
if [ ! -d "$SDK_RELATIVE_PATH" ]; then
"ERROR: Could not find SDK in $SDK_RELATIVE_PATH"
exit
fi
echo "Packing plugin ..."
# move sdk symlink (used in symlink-plugin-to-site.sh)
sym_exist=0
if [ -L "./yoti-connect/sdk" ]; then
mv "./yoti-connect/sdk" "./__sdk-sym";
sym_exist=1
fi
cp -R "$SDK_RELATIVE_PATH" "./yoti-connect/sdk"
zip -r "$NAME" "./yoti-connect"
rm -rf "./yoti-connect/sdk"
# move symlink back
if [ $sym_exist ]; then
mv "./__sdk-sym" "./yoti-connect/sdk"
fi
rm -rf sdk
echo "Plugin packed. File $NAME created."
echo ""