blob: 477693a072a6d97744297b323a65a37d400af2e2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#!/usr/bin/env bash
set -e
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <project_name> <build_directory>"
exit 1
fi
project_name="$1"
build_directory="$2"
app_path="${build_directory}/${project_name}.app"
app_version=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" ${app_path}/Contents/Info.plist)
tmp_dir=$(mktemp -d)
dmg_path="${build_directory}/${project_name}-${app_version}.dmg"
cp -R "${app_path}" "${tmp_dir}"
ln -s /Applications "${tmp_dir}/Applications"
hdiutil create -volname "${project_name}" -srcfolder "${tmp_dir}" -ov -format UDZO "${dmg_path}"
rm -rf "${tmp_dir}"
|