Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions scripts/notarize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,21 @@ if [ $notarization_method = "exit" ]; then
$notarization_method
fi

if test -f "$app"; then
if test -d "$app"; then
echo "Notarizing: $app"
zip=$app.zip
# Turn the app into a zip file that notarization will accept
ditto -c -k --keepParent $app $zip
$notarization_method $zip
run_stapler $app
ditto -c -k --keepParent "$app" "$zip"
$notarization_method "$zip"
run_stapler "$app"
Comment on lines +73 to +75
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Temporary zip file is never cleaned up

The zip archive created by ditto at $zip (dist/ActivityWatch.app.zip) is used for notarytool submission but is never removed afterwards, leaving a stale artifact alongside the .app bundle and .dmg in dist/. Consider deleting it after stapling:

Suggested change
ditto -c -k --keepParent "$app" "$zip"
$notarization_method "$zip"
run_stapler "$app"
ditto -c -k --keepParent "$app" "$zip"
$notarization_method "$zip"
run_stapler "$app"
rm -f "$zip"

else
echo "Skipping: $app"
echo "Skipping: $app (expected .app bundle directory)"
fi

if test -f "$dmg"; then
echo "Notarizing: $dmg"
$notarization_method $dmg
run_stapler $dmg
$notarization_method "$dmg"
run_stapler "$dmg"
else
echo "Skipping: $dmg"
fi
Loading