Update Simplified Chinese Strings (#1610)
[gpodder.git] / tools / mac-osx / release.sh
blob38e09aa85ff50d09fcca0e60dd3af8e84ff77435
1 #!/bin/bash
3 set -e
5 usage="Usage: $0 /path/to/gPodder.app version_buildnumber"
7 if [ -z "$1" ] ; then
8 echo "$usage"
9 exit -1
10 elif [ ! -d "$1" ] ; then
11 echo "$usage"
12 echo "$1 doesn't exist or is not a directory (give me /path/to/gPodder.app)"
13 else
14 app=$1
15 shift
18 if [ -z "$1" ] ; then
19 echo "$usage"
20 exit -1
21 else
22 version="$1"
23 shift
26 d=$(dirname "$app")
27 appname=$(basename "$app")
28 zip="${appname%.app}-$version.zip"
29 contents="${appname%.app}.contents"
31 if command -v md5 2>/dev/null; then
32 MD5=md5
33 else
34 MD5=md5sum
37 cd "$d"
38 if [ -f "$zip" ] ; then
39 echo "$d/$zip already exists!"
40 exit -1
42 echo "Creating $d/$zip..."
43 zip --symlinks -rq "$zip" "$appname" "$contents"
44 find . -maxdepth 1 -type l -exec zip -q --symlinks "$zip" '{}' ';'
46 echo "Checksumming..."
47 shasum -a256 "$zip" > "$zip.sha256"
48 "$MD5" "$zip" > "$zip.md5"
50 echo "Done"