Skip to content

fix(exe): propagate exit status from fallback Windows wrappers (pnpm/pnpm#14826) - #15547

Merged
zkochan merged 3 commits into
mainfrom
fix-14826
Sep 24, 2026
Merged

zkochan merged 3 commits into
mainfrom
fix-14826

Conversation

@zkochan

@zkochan zkochan commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Summary

When @pnpm/exe install scripts do not run (or when invoked directly in the artifact directory), fallback .cmd and .ps1 wrappers for pn, pnpx, and pnx resolve pnpm from PATH. Previously, neither wrapper forwarded the exit status of the invoked pnpm command:

  • In .cmd wrappers, the script reached EOF without returning %errorlevel%.
  • In .ps1 wrappers, PowerShell exited with code 0 upon reaching EOF because $LASTEXITCODE was not passed to exit.

This PR updates prepare.js so that:

  • .cmd wrappers end with exit /b %errorlevel%.
  • .ps1 wrappers end with exit $LASTEXITCODE.

Integration tests and assertion checks have been added in setup.test.ts to verify exit status propagation from both wrapper types on Windows.

Closes #14826

Squash Commit Body

Update fallback `.cmd` and `.ps1` Windows wrapper templates in `@pnpm/exe`
to propagate exit status from the invoked `pnpm` command via `exit /b %errorlevel%`
and `exit $LASTEXITCODE`.

Add tests in `setup.test.ts` verifying that non-zero exit status (and successful
subcommand argument forwarding) is propagated properly from both wrapper types.

Closes pnpm/pnpm#14826

Checklist

  • I checked the referenced issue and verified that none of the PRs already linked to it solves it.
  • New features are implemented only in the Rust pnpm v12 CLI. Bug fixes are implemented in every affected version.
  • Added a changeset (pnpm changeset) if this PR changes any published package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Bug Fixes
    • Windows fallback command wrappers now pass through the exit status returned by pnpm. This applies to Command Prompt and PowerShell wrappers, including the pn, pnpx, and pnx commands.
    • Commands and scripts that rely on the wrapper’s exit status now receive pnpm’s success or failure result, rather than an unrelated status from the shell. This helps automated checks report the result of the pnpm operation accurately.

@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pnpm/pnpm/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: ba0ce04a-7d4c-4297-a9c6-0ce8395000f4

📥 Commits

Reviewing files that changed from the base of the PR and between 2790826 and 0b12bf9.

📒 Files selected for processing (1)
  • pnpm11/pnpm/artifacts/exe/test/setup.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The generated Windows fallback .cmd and .ps1 wrappers now return the exit status of the invoked pnpm command. Tests cover successful and non-zero exits for the pn, pnpx, and pnx aliases.

Changes

Windows wrapper exit status

Layer / File(s) Summary
Generate wrappers that return pnpm status
pnpm11/pnpm/artifacts/exe/prepare.js, .changeset/fix-exe-windows-wrapper-exit-code.md, cspell.json
The generated .cmd and .ps1 wrappers explicitly exit with the invoked command’s status. The changeset records patch releases for @pnpm/exe and pnpm. The spelling allowlist adds errorlevel.
Test fallback wrapper exit statuses
pnpm11/pnpm/artifacts/exe/test/setup.test.ts
Tests check exit-status propagation and successful command output for all three aliases. Test helpers detect available shells and build the fallback-wrapper test environment.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Assessment against linked issues

Objective Addressed Explanation
Propagate the invoked pnpm status through generated PowerShell and .cmd fallback wrappers, while retaining PATH resolution. ✅
Add Windows tests that verify non-zero exit-status propagation for both fallback wrapper types. ✅

Merge Risk: ⚪ Minimal · up to 0b12b

The change aims to help callers detect failed pnpm commands in fallback installs. No concrete blocking regression is established, so it is ready for normal merge checks.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@zkochan
zkochan marked this pull request as ready for review September 24, 2026 12:55
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Propagate pnpm exit codes from fallback Windows wrappers

🐞 Bug fix 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Make fallback Windows alias wrappers return pnpm's success or failure status.
• Verify exit-code and argument propagation across cmd.exe, Windows PowerShell, and pwsh.
• Publish patch release notes for @pnpm/exe and pnpm.
Diagram

sequenceDiagram
    actor Caller
    participant Wrapper as Fallback wrapper
    participant Pnpm as pnpm on PATH
    Caller->>Wrapper: Run alias
    Wrapper->>Pnpm: Forward arguments
    Pnpm-->>Wrapper: Return exit status
    Wrapper-->>Caller: Propagate exit status
Loading
High-Level Assessment

The current approach is optimal: explicit exit /b %errorlevel% and exit $LASTEXITCODE statements are the native, minimal mechanisms for preserving child-process status in batch and PowerShell wrappers. Replacing the wrappers or adding an intermediary executable would introduce unnecessary packaging and platform complexity.

Files changed (4) +140 / -4

Bug fix (1) +2 / -2
prepare.jsReturn pnpm status from generated Windows wrappers +2/-2

Return pnpm status from generated Windows wrappers

• Updates generated '.cmd' wrappers to return '%errorlevel%' and '.ps1' wrappers to exit with '$LASTEXITCODE'. The behavior applies to the 'pn', 'pnpx', and 'pnx' fallback aliases.

pnpm11/pnpm/artifacts/exe/prepare.js

Tests (1) +131 / -2
setup.test.tsTest fallback wrapper status and argument propagation +131/-2

Test fallback wrapper status and argument propagation

• Updates generated-content assertions and adds sandboxed integration coverage for successful and failing '.cmd' and '.ps1' invocations. Tests probe available PowerShell implementations, verify status 42 propagation, confirm alias arguments, and clean up temporary fixtures.

pnpm11/pnpm/artifacts/exe/test/setup.test.ts

Documentation (1) +6 / -0
fix-exe-windows-wrapper-exit-code.mdDocument Windows wrapper exit-code fix +6/-0

Document Windows wrapper exit-code fix

• Adds patch release entries for '@pnpm/exe' and 'pnpm', documenting that fallback Windows wrappers now propagate pnpm's exit status.

.changeset/fix-exe-windows-wrapper-exit-code.md

Other (1) +1 / -0
cspell.jsonAllow the Windows errorlevel term +1/-0

Allow the Windows errorlevel term

• Adds 'errorlevel' to the spell-check dictionary for the batch wrapper command and related assertions.

cspell.json

@zkochan

zkochan commented Sep 24, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Pull request base or head changed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@qodo-code-review

qodo-code-review Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Command wrapper regression goes untested ✓ Resolved 📜 Skill insight ▣ Testability
Description
buildFallbackSandbox installs a pnpm.cmd stub, so cmd.exe transfers batch execution to that
stub without returning to the wrapper line added in prepare.js. The non-zero assertion therefore
receives 42 even with the exit-propagation line removed, leaving the executable-on-PATH case that
actually reaches exit /b %errorlevel% uncovered.
Code

pnpm11/pnpm/artifacts/exe/test/setup.test.ts[R560-563]

+  fs.writeFileSync(
+    path.join(stubDir, 'pnpm.cmd'),
+    '@echo off\r\nif "%1"=="fail" exit /b 42\r\nif "%2"=="fail" exit /b 42\r\nif "%3"=="fail" exit /b 42\r\necho stub: %*\r\nexit /b 0\r\n'
+  )
Relevance

●●● Strong

Recent history accepts strengthening regression tests when current coverage can pass without
exercising the production fix.

PR-#14642
PR-#15240

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 3365251 requires regression coverage that fails without the production fix. The generated
wrapper adds exit propagation after invoking pnpm, but the test puts a batch file at that command
name; Windows batch chaining transfers execution to that file without returning, so its explicit
exit status does not depend on the new wrapper line.

pnpm11/pnpm/artifacts/exe/prepare.js[41-42]
pnpm11/pnpm/artifacts/exe/test/setup.test.ts[560-563]
pnpm11/pnpm/artifacts/exe/test/setup.test.ts[428-437]
Skill: review-code

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The command-wrapper regression test uses a nested `.cmd` stub, which transfers control away from the wrapper and returns the stub's status without exercising the added `exit /b %errorlevel%` line.

## Fix Focus Areas
- pnpm11/pnpm/artifacts/exe/test/setup.test.ts[560-563]

## Recommended Fix
Use a `pnpm.exe` test fixture or equivalent executable stand-in that returns a known non-zero status. Ensure the wrapper regains control after invoking it, then assert that the wrapper propagates that status and that the test fails when the added exit line is removed.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Fallback tests fail in unusual temp paths 🐞 Bug ☼ Reliability ⭐ New
Description
getWindowsFallbackEnv replaces every backslash in stubJs with a forward slash regardless of the
host platform. On POSIX, a backslash can be part of os.tmpdir() or the generated sandbox path, so
NODE_OPTIONS points to a different file and the PowerShell tests fail before loading the stub.
Code

pnpm11/pnpm/artifacts/exe/test/setup.test.ts[602]

+  const stubJs = path.join(stubDir, 'stub.cjs').replace(/\\/g, '/')
Relevance

●●● Strong

Deterministic cross-platform path bug; normalize backslashes only on Windows to preserve valid POSIX
filenames.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The sandbox and stub are created using os.tmpdir() and path.join, so their POSIX path may
legally contain a backslash. The helper then unconditionally rewrites that path before assigning it
to NODE_OPTIONS, which is used by the PowerShell tests that also run with pwsh on non-Windows
hosts.

pnpm11/pnpm/artifacts/exe/test/setup.test.ts[559-562]
pnpm11/pnpm/artifacts/exe/test/setup.test.ts[465-472]
pnpm11/pnpm/artifacts/exe/test/setup.test.ts[490-495]
pnpm11/pnpm/artifacts/exe/test/setup.test.ts[602-607]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`getWindowsFallbackEnv` unconditionally converts backslashes in the stub path to forward slashes. Backslashes are valid filename characters on POSIX, so a temporary directory containing one makes `NODE_OPTIONS` reference a nonexistent stub file.

## Fix Focus Areas
- pnpm11/pnpm/artifacts/exe/test/setup.test.ts[602-602]

## Recommended Fix
Apply backslash normalization only when `isWindows` is true, or otherwise preserve the native path returned by `path.join` on POSIX systems before placing it in `NODE_OPTIONS`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Windows wrappers can hide failures 🐞 Bug ≡ Correctness
Description
prepare.js emits exit /b %errorlevel%, whose expansion reads an inherited ERRORLEVEL
environment variable instead of cmd.exe's dynamic status when that variable exists. Under
ERRORLEVEL=0, every fallback alias can report success after pnpm fails, while another fixed value
can replace successful statuses.
Code

pnpm11/pnpm/artifacts/exe/prepare.js[41]

+  fs.writeFileSync(path.join(ownDir, name + '.cmd'), `@echo off\npnpm${subcommand} %*\nexit /b %errorlevel%\n`)
Relevance

●●● Strong

Directly exposes a real Windows exit-status bug in the PR’s wrapper change; closely aligned with the
stated fix intent.

PR-#14905

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The fallback wrappers deliberately execute pnpm through the caller's PATH and environment, and the
changed line expands %errorlevel% after that invocation. The tests inherit the complete process
environment, but their only Windows stub is another batch file whose explicit exit /b transfers
control without returning to the added wrapper line, so they do not cover shadowing of the
expansion.

pnpm11/pnpm/artifacts/exe/prepare.js[24-30]
pnpm11/pnpm/artifacts/exe/prepare.js[40-42]
pnpm11/pnpm/artifacts/exe/test/setup.test.ts[560-563]
pnpm11/pnpm/artifacts/exe/test/setup.test.ts[575-582]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The generated `.cmd` wrappers expand `%errorlevel%`, which can be shadowed by an inherited `ERRORLEVEL` environment variable and return the wrong status.

## Fix Focus Areas
- pnpm11/pnpm/artifacts/exe/prepare.js[41-41]
- pnpm11/pnpm/artifacts/exe/test/setup.test.ts[84-84]
- pnpm11/pnpm/artifacts/exe/test/setup.test.ts[428-450]

## Recommended Fix
Generate `exit /b` without an explicit argument so cmd.exe preserves the status of the preceding pnpm invocation without environment-variable expansion. Update the content assertion and add coverage with `ERRORLEVEL` predefined, using an executable PATH target that returns to the outer wrapper rather than a chained `.cmd` stub.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

4. Two test fixture calls omit commas ⊘ Outdated 📘 Rule violation ⚙ Maintainability
Description
buildFallbackSandbox leaves the final string argument without a trailing comma in both multi-line
fs.writeFileSync calls. The newly added command and shell stubs therefore introduce inconsistent
TypeScript list formatting at lines 562 and 568.
Code

pnpm11/pnpm/artifacts/exe/test/setup.test.ts[562]

+    '@echo off\r\nif "%1"=="fail" exit /b 42\r\nif "%2"=="fail" exit /b 42\r\nif "%3"=="fail" exit /b 42\r\necho stub: %*\r\nexit /b 0\r\n'
Relevance

● Weak

Recent repository precedent rejects trailing-comma findings in multiline TypeScript lists despite
the formatting rule.

PR-#15416

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 713434 requires a trailing comma on the final item of multi-line TypeScript argument lists.
Both added fs.writeFileSync calls end their final string argument without one.

Rule 713434: Require trailing commas in TypeScript collections and multi-line constructs
pnpm11/pnpm/artifacts/exe/test/setup.test.ts[560-563]
pnpm11/pnpm/artifacts/exe/test/setup.test.ts[566-569]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Two newly added multi-line TypeScript argument lists omit the required trailing comma after their final string argument.

## Fix Focus Areas
- pnpm11/pnpm/artifacts/exe/test/setup.test.ts[562-563]
- pnpm11/pnpm/artifacts/exe/test/setup.test.ts[568-569]

## Recommended Fix
Add a comma after each final string argument in the two multi-line `fs.writeFileSync` calls.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 53 rules
✅ Skills: review-code
✅ Cross-repo context — repo relationships
  Explored: repo: pnpm/setup (sha: fbda4c85) — View relationship
  Explored: repo: pnpm/get.pnpm.io (sha: 916ce9e8) — View relationship
Review mode: ⚖️ Balanced: This is a localized Windows wrapper behavior fix with meaningful cross-shell exit-status semantics and integration-test changes, warranting a careful single-pass review but not redundant extended review.

Grey Divider

Tip of the day
💡 Did you know, you can choose which labels appear on a finding, and whether they show icons or text

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 89c1731

Results up to commit 50dab2a ⚖️ Balanced


🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required
1. Command wrapper regression goes untested ✓ Resolved 📜 Skill insight ▣ Testability
Description
buildFallbackSandbox installs a pnpm.cmd stub, so cmd.exe transfers batch execution to that
stub without returning to the wrapper line added in prepare.js. The non-zero assertion therefore
receives 42 even with the exit-propagation line removed, leaving the executable-on-PATH case that
actually reaches exit /b %errorlevel% uncovered.
Code

pnpm11/pnpm/artifacts/exe/test/setup.test.ts[R560-563]

+  fs.writeFileSync(
+    path.join(stubDir, 'pnpm.cmd'),
+    '@echo off\r\nif "%1"=="fail" exit /b 42\r\nif "%2"=="fail" exit /b 42\r\nif "%3"=="fail" exit /b 42\r\necho stub: %*\r\nexit /b 0\r\n'
+  )
Relevance

●●● Strong

Recent history accepts strengthening regression tests when current coverage can pass without
exercising the production fix.

PR-#14642
PR-#15240

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 3365251 requires regression coverage that fails without the production fix. The generated
wrapper adds exit propagation after invoking pnpm, but the test puts a batch file at that command
name; Windows batch chaining transfers execution to that file without returning, so its explicit
exit status does not depend on the new wrapper line.

pnpm11/pnpm/artifacts/exe/prepare.js[41-42]
pnpm11/pnpm/artifacts/exe/test/setup.test.ts[560-563]
pnpm11/pnpm/artifacts/exe/test/setup.test.ts[428-437]
Skill: review-code

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The command-wrapper regression test uses a nested `.cmd` stub, which transfers control away from the wrapper and returns the stub's status without exercising the added `exit /b %errorlevel%` line.

## Fix Focus Areas
- pnpm11/pnpm/artifacts/exe/test/setup.test.ts[560-563]

## Recommended Fix
Use a `pnpm.exe` test fixture or equivalent executable stand-in that returns a known non-zero status. Ensure the wrapper regains control after invoking it, then assert that the wrapper propagates that status and that the test fails when the added exit line is removed.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended
2. Windows wrappers can hide failures 🐞 Bug ≡ Correctness
Description
prepare.js emits exit /b %errorlevel%, whose expansion reads an inherited ERRORLEVEL
environment variable instead of cmd.exe's dynamic status when that variable exists. Under
ERRORLEVEL=0, every fallback alias can report success after pnpm fails, while another fixed value
can replace successful statuses.
Code

pnpm11/pnpm/artifacts/exe/prepare.js[41]

+  fs.writeFileSync(path.join(ownDir, name + '.cmd'), `@echo off\npnpm${subcommand} %*\nexit /b %errorlevel%\n`)
Relevance

●●● Strong

Directly exposes a real Windows exit-status bug in the PR’s wrapper change; closely aligned with the
stated fix intent.

PR-#14905

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The fallback wrappers deliberately execute pnpm through the caller's PATH and environment, and the
changed line expands %errorlevel% after that invocation. The tests inherit the complete process
environment, but their only Windows stub is another batch file whose explicit exit /b transfers
control without returning to the added wrapper line, so they do not cover shadowing of the
expansion.

pnpm11/pnpm/artifacts/exe/prepare.js[24-30]
pnpm11/pnpm/artifacts/exe/prepare.js[40-42]
pnpm11/pnpm/artifacts/exe/test/setup.test.ts[560-563]
pnpm11/pnpm/artifacts/exe/test/setup.test.ts[575-582]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The generated `.cmd` wrappers expand `%errorlevel%`, which can be shadowed by an inherited `ERRORLEVEL` environment variable and return the wrong status.

## Fix Focus Areas
- pnpm11/pnpm/artifacts/exe/prepare.js[41-41]
- pnpm11/pnpm/artifacts/exe/test/setup.test.ts[84-84]
- pnpm11/pnpm/artifacts/exe/test/setup.test.ts[428-450]

## Recommended Fix
Generate `exit /b` without an explicit argument so cmd.exe preserves the status of the preceding pnpm invocation without environment-variable expansion. Update the content assertion and add coverage with `ERRORLEVEL` predefined, using an executable PATH target that returns to the outer wrapper rather than a chained `.cmd` stub.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational
3. Two test fixture calls omit commas ⊘ Outdated 📘 Rule violation ⚙ Maintainability
Description
buildFallbackSandbox leaves the final string argument without a trailing comma in both multi-line
fs.writeFileSync calls. The newly added command and shell stubs therefore introduce inconsistent
TypeScript list formatting at lines 562 and 568.
Code

pnpm11/pnpm/artifacts/exe/test/setup.test.ts[562]

+    '@echo off\r\nif "%1"=="fail" exit /b 42\r\nif "%2"=="fail" exit /b 42\r\nif "%3"=="fail" exit /b 42\r\necho stub: %*\r\nexit /b 0\r\n'
Relevance

● Weak

Recent repository precedent rejects trailing-comma findings in multiline TypeScript lists despite
the formatting rule.

PR-#15416

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 713434 requires a trailing comma on the final item of multi-line TypeScript argument lists.
Both added fs.writeFileSync calls end their final string argument without one.

Rule 713434: Require trailing commas in TypeScript collections and multi-line constructs
pnpm11/pnpm/artifacts/exe/test/setup.test.ts[560-563]
pnpm11/pnpm/artifacts/exe/test/setup.test.ts[566-569]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Two newly added multi-line TypeScript argument lists omit the required trailing comma after their final string argument.

## Fix Focus Areas
- pnpm11/pnpm/artifacts/exe/test/setup.test.ts[562-563]
- pnpm11/pnpm/artifacts/exe/test/setup.test.ts[568-569]

## Recommended Fix
Add a comma after each final string argument in the two multi-line `fs.writeFileSync` calls.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 2790826

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Sep 24, 2026
@blacksmith-sh

This comment has been minimized.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 0b12bf9

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

Update fallback `.cmd` and `.ps1` Windows wrapper templates in `@pnpm/exe`
to propagate exit status from the invoked `pnpm` command via `exit /b %errorlevel%`
and `exit $LASTEXITCODE`.
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 89c1731

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@zkochan
zkochan merged commit 6d31f80 into main Sep 24, 2026
38 checks passed
@zkochan
zkochan deleted the fix-14826 branch September 24, 2026 20:05
u9g pushed a commit to u9g/pnpm that referenced this pull request Sep 25, 2026
…14826) (pnpm#15547)

Update fallback `.cmd` and `.ps1` Windows wrapper templates in `@pnpm/exe`
to propagate exit status from the invoked `pnpm` command via `exit /b %errorlevel%`
and `exit $LASTEXITCODE`.

Add tests in `setup.test.ts` verifying that non-zero exit status (and successful
subcommand argument forwarding) is propagated properly from both wrapper types.

Closes pnpm#14826
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pnpm@11 reviewed: coderabbit CodeRabbit submitted an approving review state: automerge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(@pnpm/exe): propagate exit status from fallback Windows wrappers

1 participant