-
Notifications
You must be signed in to change notification settings - Fork 49
/
.build.sh
36 lines (33 loc) · 1.16 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
#!/bin/bash
# ------------------------------------------------------------------
## Author = Navjot Tomer
##
## Description
## Basic script for generating Osclass release zip package
##
##
# Current latest osclass tag
LATEST_TAG=$(git describe --tags --abbrev=0)
echo 'Osclass build started for v'"$LATEST_TAG"
# Delete any previous release directory
DIR="release"
if [ -d "$DIR" ]; then
### An existing directory exists delete it ###
echo 'removing existing release directory'
rm -r release
fi
### Make directory ###
mkdir release
# Create Osclass release archive
git archive --output=release/osclass_no_theme.zip "$LATEST_TAG"
unzip -qq release/osclass_no_theme.zip -d release/osclass
# Download latest bender-theme release from repository
echo 'Downloading latest bender theme'
cd release && curl -s https://api.github.com/repos/mindstellar/theme-bender/releases/latest |
grep 'browser_download_url' |
head -1 |
cut -d '"' -f 4 |
wget -qi - && unzip -qq bender_*.zip -d osclass/oc-content/themes/
# create new release with bender included
(zip ./osclass_v"$LATEST_TAG".zip -r osclass 1>/dev/null)
echo 'Build create successfully in release/osclass_v'"$LATEST_TAG"'.zip'