-
Notifications
You must be signed in to change notification settings - Fork 24
/
vip_build.sh
executable file
·41 lines (28 loc) · 980 Bytes
/
vip_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
#!/bin/bash
LINES_TO_REMOVE=7
echo "Building VIP Version of the plugin"
mkdir -p build;
cp -r jw-player build/;
# Remove import.php
if [ -f "build/jw-player/include/import.php" ]
then
rm "build/jw-player/include/import.php";
fi
# Remove the last lines from the jw-player.php file.
mv "build/jw-player/jw-player.php" "build/jw-player.php";
cat "build/jw-player.php" | tail -r | tail +$(($LINES_TO_REMOVE + 1)) | tail -r >> "build/jw-player/jw-player.php";
rm "build/jw-player.php";
PLUGIN_VERSION=$(awk '/Version: /{print $2}' "build/jw-player/jw-player.php");
# Remove older zip of the same version
if [ -f "build/jw-player_vip_v$PLUGIN_VERSION.zip" ]
then
echo "Removing older zip of the same version";
rm "build/jw-player_vip_v$PLUGIN_VERSION.zip";
fi
cd build;
zip -mqr "jw-player_vip_v$PLUGIN_VERSION.zip" jw-player -x *.svn* -x *.DS_Store;
cd ../;
echo "Removing temporary directory";
rm -rf "build/jw-player";
# Remove jw player directory
echo "Done."