-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
37 lines (32 loc) · 825 Bytes
/
entrypoint.sh
File metadata and controls
37 lines (32 loc) · 825 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
#! /bin/sh
# Create archive or exit if command fails
set -eu
printf "\n📦 Creating %s archive...\n" "$5"
if [ "$3" != "." ]
then
cd $3
fi
yarn
chmod -R 777 ./
CI=false npm run create-production-linux-win
cd dist
if [ "$5" = "zip" ]
then
if [ -z "$4" ]
then
zip -r $1 $2 || { printf "\n⛔ Unable to create %s archive.\n" "$5"; exit 1; }
else
zip -r $1 $2 -x $4 || { printf "\n⛔ Unable to create %s archive.\n" "$5"; exit 1; }
fi
elif [ "$5" = "tar" ]
then
if [ -z "$4" ]
then
tar -zcvf $1 $2 || { printf "\n⛔ Unable to create %s archive.\n" "$5"; exit 1; }
else
tar -zcvf $1 $2 --exclude=$4 || { printf "\n⛔ Unable to create %s archive.\n" "$5"; exit 1; }
fi
else
printf "\n⛔ Invalid archiving tool.\n"; exit 1;
fi
printf "\n✔ Successfully created %s archive.\n" "$5"