Repository navigation
feat: add script to package MacDirStat.app - #7
Merged
Merged
Conversation
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>
This was referenced Oct 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.shdoes a release build and wraps it in.build/MacDirStat.app:Info.plistwith bundle IDio.github.phalladar.MacDirStat, version0.1.0,CFBundleIconFile, macOS 15 minimumAppIcon.icnsinContents/Resources, so Finder, Spotlight, Launchpad and Cmd-Tab show the iconContents/Resources, whereBundle.modulelooks firstREADME gets a two-line "install to /Applications" section; CLAUDE.md lists the script.
Tested locally: the script builds,
plutil -lintandcodesign --verify --deep --strictpass, Finder renders the custom icon for/Applications/MacDirStat.app, andopenlaunches 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