-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake_package.sh
More file actions
44 lines (36 loc) · 890 Bytes
/
make_package.sh
File metadata and controls
44 lines (36 loc) · 890 Bytes
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
#!/bin/bash
CODE_DIR=$1
if [ -z "$CODE_DIR" ]; then
CODE_DIR='32KUL_LIBIS_NETWORK??'
fi
VIEWS="32KUL_LIBIS_NETWORK-CENTRAL_PACKAGE"
OS=$(uname -s)
if [ -e "./package" ]; then
mkdir -p "./package/"
fi
for VIEW in $VIEWS; do
echo "Packaging $VIEW"
if [ -e "./package/$VIEW.zip" ]; then
rm ./package/$VIEW.zip
fi
if [ -e "./tmpPackage" ]; then
rm -Rf "./tmpPackage"
fi
mkdir -p "./tmpPackage/$VIEW"
cd "./tmpPackage"
cp -rp ../resources/general/* ./$VIEW
cp -rp ../resources/$VIEW/* ./$VIEW
if [ ! -e "./$VIEW/js" ]; then
mkdir ./$VIEW/js
fi
#TODO: make dynamic
cp -rp ../dist/$CODE_DIR/js/custom.js ./$VIEW/js
find . -name '.DS_Store' -exec rm -f {} \;
if [ "$OS" = "Darwin" ]; then
COPYFILE_DISABLE=1 zip -q -r ../package/$VIEW.zip ./$VIEW
else
zip -q -r ../package/$VIEW.zip ./$VIEW
fi
cd -
rm -Rf "./tmpPackage"
done