#!/usr/bin/env bash set -e if [ "$#" -ne 2 ]; then echo "Usage: $0 " 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) dmg_path="${build_directory}/${project_name}-${app_version}.dmg" xcrun notarytool submit ${dmg_path} --wait --verbose --keychain-profile "Apps @ Unlimited Pizza" stapler staple "${app_path}"