Skip to content

feat: add script to package MacDirStat.app - #7

Merged
phalladar merged 4 commits into
mainfrom
app-bundle
Oct 3, 2026
Merged

phalladar merged 4 commits into
mainfrom
app-bundle

Conversation

@phalladar

Copy link
Copy Markdown
Owner

Merge #1 first. This branch is stacked on #1 (it uses its AppIcon.icns), so until #1 lands the diff here also shows #1's two commits. The only new commit is the last one.

A bare SPM executable shows up in Finder as a generic Terminal icon and has no bundle identifier, so permissions like Full Disk Access attach to Terminal instead of MacDirStat.

scripts/build-app.sh does a release build and wraps it in .build/MacDirStat.app:

  • Info.plist with bundle ID io.github.phalladar.MacDirStat, version 0.1.0, CFBundleIconFile, macOS 15 minimum
  • AppIcon.icns in Contents/Resources, so Finder, Spotlight, Launchpad and Cmd-Tab show the icon
  • SPM's resource bundle copied into Contents/Resources, where Bundle.module looks first
  • Ad-hoc signed so the bundle's signature is valid

README gets a two-line "install to /Applications" section; CLAUDE.md lists the script.

Tested locally: the script builds, plutil -lint and codesign --verify --deep --strict pass, Finder renders the custom icon for /Applications/MacDirStat.app, and open launches it and it quits cleanly.

Known limitation: with an ad-hoc signature, macOS treats each rebuild as a new app, so Full Disk Access has to be re-granted after rebuilding. Fixing that needs a Developer ID certificate.

🤖 Generated with Claude Code

Kamil Wolter and others added 4 commits March 19, 2026 11:54
SPM's Bundle.module calls fatalError if MacDirStat_MacDirStat.bundle
isn't beside the binary, so copying the release binary anywhere else
(e.g. /Applications) crashed on launch. Look the bundle up the same way
but treat a miss as no icon.

Also set the icon in applicationWillFinishLaunching so the Dock doesn't
briefly show the generic executable icon, and clear the executable bit
on AppIcon.icns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A bare SPM executable shows a generic Terminal icon in Finder and has no
bundle identifier, so permissions like Full Disk Access attach to
Terminal. scripts/build-app.sh wraps the release build in a .app with an
Info.plist, the app icon, and SPM's resource bundle, then ad-hoc signs it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@phalladar
phalladar merged commit 464269d into main Oct 3, 2026
1 check passed
@phalladar
phalladar deleted the app-bundle branch October 3, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant