-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmake-package.sh
More file actions
executable file
·40 lines (30 loc) · 867 Bytes
/
Copy pathmake-package.sh
File metadata and controls
executable file
·40 lines (30 loc) · 867 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
#!/bin/bash
set -u # forbid undefined variables
set -e # forbid command failure
#
# Execute make command
#
cd $(dirname $0)
version=$(cat version)
echo "make build"
make build
if [ ${PIPESTATUS[0]} -ne 0 ]; then
exit 99
fi
#
# Create dmg
#
dmg=Tinkle-$version.dmg
rm -f $dmg
# create-dmg
if [[ -n "${PQRS_ORG_CODE_SIGN_IDENTITY:-}" ]]; then
# find identity for create-dmg
identity=$(security find-identity -v -p codesigning | grep "${PQRS_ORG_CODE_SIGN_IDENTITY}" | grep -oE '"[^"]+"$' | sed 's|^"||' | sed 's|"$||')
create-dmg --overwrite --identity="$identity" src/build/Release/Tinkle.app
else
# create-dmg is always failed if codesign identity is not found.
set +e # allow command failure
create-dmg --overwrite src/build/Release/Tinkle.app
set -e # forbid command failure
fi
mv "Tinkle $version.dmg" Tinkle-$version.dmg