Conversation
Add a new --install CLI option that, after a successful macOS DMG build, automatically mounts the DMG, copies the .app bundle to /Applications (replacing any existing version), unmounts the volume, and removes the installer DMG. This eliminates the manual mount-drag-unmount-delete workflow that users must perform after every build.
There was a problem hiding this comment.
Pull request overview
Adds an opt-in --install flag to the Pake CLI to automatically install a successfully built macOS DMG’s .app into /Applications, and (on success) remove the generated DMG to eliminate the manual mount/copy/unmount/delete workflow.
Changes:
- Add
install: booleanto CLI options + defaults. - Register
--installas a visible CLI flag. - Add DMG post-build installation flow in
BaseBuilder(and compileddist/cli.js), plus a unit test for flag registration.
Reviewed changes
Copilot reviewed 1 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
bin/types.ts |
Adds install option to PakeCliOptions. |
bin/defaults.ts |
Defaults install to false (opt-in). |
bin/helpers/cli-program.ts |
Registers --install flag in Commander help/options. |
bin/builders/BaseBuilder.ts |
Implements installDmgToApplications() and calls it after DMG build success. |
tests/unit/cli-options.test.ts |
Verifies --install option is registered with default false. |
dist/cli.js |
Updates compiled CLI output to include new option + install logic. |
Use a temporary mountpoint for DMG installation to avoid failures caused by volume-name mismatches or already-mounted /Volumes entries. Discover the app bundle from the mounted image, always cleanup mount resources in finally, and force-detach as a fallback.
|
Quick update: I pushed a follow-up fix commit to harden the macOS What was fixed:
Why this matters:
Validation:
|
|
Thanks for the PR. I pushed a maintainer follow-up directly to your branch to simplify the macOS flow: instead of building a DMG and mounting it, we now build a standard Tauri bundle and copy it directly into . I also added CLI docs in both English and Chinese, rebuilt , and re-ran the test suite.\n\nI also verified the end-to-end install flow locally on macOS. The PR is now merged into . Appreciate you opening this and getting the feature started. |
Summary
--installCLI flag that automatically installs built macOS apps to/Applicationsand removes the installer DMG after a successful buildpakebuild on macOSCloses #1143
Changes
bin/types.tsinstall: booleantoPakeCliOptionsbin/defaults.tsinstall: falsebin/helpers/cli-program.ts--installCLI option (visible in help)bin/builders/BaseBuilder.tsinstallDmgToApplications()method + call site after build successtests/unit/cli-options.test.ts--installoption registrationHow it works
When
--installis passed on macOS with a DMG target:hdiutil attach.appto/Applications(replaces existing if present)hdiutil detachOn failure, the DMG is preserved and an error is logged.
Usage
pake https://example.com --name "MyApp" --installDesign decisions
false, zero impact on existing workflowsIS_MAC && fileType === 'dmg'(future Linux/Windows support could follow separately)execadirectly — avoidsshellExecwhich is tied tonpmDirectoryas cwd--help— not hidden, since it's a user-facing quality-of-life featureTesting
/Applicationssuccessfully