]> git.r.bdr.sh - rbdr/captura/blame - scripts/package.sh
Use tinted PDF for Icon
[rbdr/captura] / scripts / package.sh
CommitLineData
578c4751
RBR
1#!/usr/bin/env bash
2
3set -e
4
5
6if [ "$#" -ne 2 ]; then
7 echo "Usage: $0 <project_name> <build_directory>"
8 exit 1
9fi
10
11project_name="$1"
12build_directory="$2"
13
14app_path="${build_directory}/${project_name}.app"
15app_version=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" ${app_path}/Contents/Info.plist)
16tmp_dir=$(mktemp -d)
17dmg_path="${build_directory}/${project_name}-${app_version}.dmg"
18cp -R "${app_path}" "${tmp_dir}"
19ln -s /Applications "${tmp_dir}/Applications"
20hdiutil create -volname "${project_name}" -srcfolder "${tmp_dir}" -ov -format UDZO "${dmg_path}"
21rm -rf "${tmp_dir}"