Skip to content

feat: add --manualExit flag to skip -quit for builds - #62

Merged
frostebite merged 2 commits into
mainfrom
drop-quit-flag
Aug 13, 2026
Merged

feat: add --manualExit flag to skip -quit for builds#62
frostebite merged 2 commits into
mainfrom
drop-quit-flag

Conversation

@frostebite

@frostebite frostebite commented Aug 13, 2026

Copy link
Copy Markdown
Member

Closes #13.

Adds a --manualExit build option (default false, current behavior unchanged) that skips passing -quit to the Unity editor during the build step. Some build methods need to enter play mode from a static build method — which doesn't work if -quit is also present — to run in-game validation before packaging (exact scenario described in #13). With --manualExit, the build method is responsible for calling EditorApplication.Exit(0) itself once it's done; if it doesn't, the build will hang until it times out (documented in the flag's --help description).

Implementation:

  • New --manualExit option in build-options.ts.
  • Passed through as a MANUAL_EXIT env var via image-environment-factory.ts, same mechanism as other build settings reaching the container.
  • Linux/Mac build.sh and Windows build.ps1 conditionally include -quit based on $MANUAL_EXIT/$Env:MANUAL_EXIT.

Testing

  • New tests in build-options.test.ts (flag parses, defaults to false) and image-environment-factory.test.ts (env var only appears when set).
  • bash -n syntax-checked both modified shell scripts.
  • Full suite: bun test — 105 pass, 0 fail. bun run build — builds clean.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

Summary by CodeRabbit

  • New Features

    • Added a manualExit build option, disabled by default.
    • When enabled, Unity remains open after the build completes, allowing manual termination.
  • Tests

    • Added coverage confirming default behavior and the --manualExit option.
    • Added validation for the corresponding build environment setting.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f5d3115f-6ca6-4509-af10-59c374e8fb35

📥 Commits

Reviewing files that changed from the base of the PR and between 99fbe74 and a98f48e.

⛔ Files ignored due to path filters (4)
  • dist/index.js is excluded by !**/dist/**
  • dist/platforms/mac/steps/build.sh is excluded by !**/dist/**
  • dist/platforms/ubuntu/steps/build.sh is excluded by !**/dist/**
  • dist/platforms/windows/build.ps1 is excluded by !**/dist/**
📒 Files selected for processing (4)
  • src/command-options/build-options.test.ts
  • src/command-options/build-options.ts
  • src/logic/unity/environment.ts
  • src/model/image-environment-factory.test.ts

📝 Walkthrough

Walkthrough

The change adds a manualExit build option with a false default. When enabled, the Unity environment includes MANUAL_EXIT=true. Tests cover option parsing and environment generation.

Changes

Manual exit control

Layer / File(s) Summary
Manual exit option
src/command-options/build-options.ts, src/command-options/build-options.test.ts
Adds the boolean manualExit option with a false default and tests default and enabled parsing.
Unity environment mapping
src/logic/unity/environment.ts, src/model/image-environment-factory.test.ts
Adds MANUAL_EXIT when manualExit is enabled and tests its default omission and enabled value.

Estimated code review effort: 2 (Simple) | ~10 minutes

Mergeability Score: ⚪ Minimal · up to a98f4

The change adds an opt-in build flag while preserving the default behavior, with documented tests and successful build checks; no actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Linked Issues check ❓ Inconclusive The option and environment wiring match issue #13, but the platform script changes are not present in the reviewable file summary. Provide reviewable evidence that Linux, macOS, and Windows build scripts conditionally omit -quit when MANUAL_EXIT is enabled.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes adding the --manualExit flag and its purpose.
Description check ✅ Passed The description explains the change, rationale, implementation, and tests, but it does not reproduce the template checklist.
Out of Scope Changes check ✅ Passed The reviewed changes support the --manualExit feature and the requirements in issue #13; no unrelated changes are evident.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch drop-quit-flag

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

frostebite and others added 2 commits August 13, 2026 04:59
Some build methods need to enter play mode (e.g. to run in-game
validation before packaging) and can't do that from a static method
while -quit is also passed to the editor. This adds a --manualExit
CLI flag (default false, preserving current behavior) that skips
-quit in the Unity command line; the build method is then responsible
for calling EditorApplication.Exit(0) itself.

Wired through as a MANUAL_EXIT env var (consistent with how other
build options reach the container) and consumed by the Linux, Mac,
and Windows build scripts to conditionally omit -quit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

Add config flag that drops -quit from builder

1 participant