-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.sh
executable file
·44 lines (39 loc) · 1.33 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
#!/usr/bin/env bash
##
# Copyright (C) 2017-2019 thirty bees
#
# NOTICE OF LICENSE
#
# This source file is subject to the Academic Free License (AFL 3.0)
# that is bundled with this package in the file LICENSE.md.
# It is also available through the world-wide-web at this URL:
# http://opensource.org/licenses/afl-3.0.php
# If you did not receive a copy of the license and are unable to
# obtain it through the world-wide-web, please send an email
# to [email protected] so we can send you a copy immediately.
#
# @author thirty bees <[email protected]>
# @copyright 2017-2019 thirty bees
# @license Academic Free License (AFL 3.0)
CWD_BASENAME=${PWD##*/}
FILES=("ajax-upgradetab.php")
FILES+=("alias.php")
FILES+=("cacert.pem")
FILES+=("functions.php")
FILES+=("init.php")
FILES+=("logo.gif")
FILES+=("logo.png")
FILES+=("${CWD_BASENAME}.php")
FILES+=("cache/**")
FILES+=("classes/**")
FILES+=("controllers/**")
FILES+=("json/**")
FILES+=("views/**")
MODULE_VERSION="$(sed -ne "s/\\\$this->version *= *['\"]\([^'\"]*\)['\"] *;.*/\1/p" ${CWD_BASENAME}.php)"
MODULE_VERSION=${MODULE_VERSION//[[:space:]]}
ZIP_FILE="${CWD_BASENAME}/${CWD_BASENAME}-v${MODULE_VERSION}.zip"
echo "Going to zip ${CWD_BASENAME} version ${MODULE_VERSION}"
cd ..
for E in "${FILES[@]}"; do
find ${CWD_BASENAME}/${E} -type f -exec zip -9 ${ZIP_FILE} {} \;
done