-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·50 lines (41 loc) · 849 Bytes
/
release.sh
File metadata and controls
executable file
·50 lines (41 loc) · 849 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
45
46
47
48
49
50
#!/bin/bash
set -e
usage="Usage: $0 /path/to/gPodder.app version_buildnumber"
if [ -z "$1" ] ; then
echo "$usage"
exit -1
elif [ ! -d "$1" ] ; then
echo "$usage"
echo "$1 doesn't exist or is not a directory (give me /path/to/gPodder.app)"
else
app=$1
shift
fi
if [ -z "$1" ] ; then
echo "$usage"
exit -1
else
version="$1"
shift
fi
d=$(dirname "$app")
appname=$(basename "$app")
zip="${appname%.app}-$version.zip"
contents="${appname%.app}.contents"
if (which md5 >& /dev/null) ; then
MD5=md5
else
MD5=md5sum
fi
cd "$d"
if [ -f "$zip" ] ; then
echo "$d/$zip already exists!"
exit -1
fi
echo "Creating $d/$zip..."
zip --symlinks -rq "$zip" "$appname" "$contents"
find . -maxdepth 1 -type l -exec zip -q --symlinks "$zip" '{}' ';'
echo "Checksumming..."
shasum -a256 "$zip" > "$zip.sha256"
"$MD5" "$zip" > "$zip.md5"
echo "Done"