handle executable paths with spaces in CLI arguments, close #5845
Type
- [x] Bug Fix
Description
Fixes executable path splitting when paths contain spaces (e.g., C:\Program Files\nodejs\node.exe on Windows or /usr/local/My Programs/node on Unix-like systems).
Instead of using executable.split(/\s+/) which breaks any path with spaces, we now extract runtime and script directly from the original args array using Arr.take(originalArgs, 2).
Changes:
- Modified
handleBuiltInOption()to acceptoriginalArgsparameter - Fixed
SetLogLevelcase to preserve paths with spaces when re-executing commands - Fixed
ShowWizardcase to preserve paths with spaces when running wizard-constructed commands - Added helper function
getExecutableArgs()to extract runtime and script from original args - Added test case for executable paths with spaces in
CliApp.test.ts
Test plan:
- ✅ All existing 146 tests pass
- ✅ Added new test for executable paths with spaces
- ✅ Manually tested with minigit example:
npx tsx examples/minigit.ts --log-level info -c test=value clone https://github.com/test/repo
Related
- Closes #5845
🦋 Changeset detected
Latest commit: d68996ce151be94bc5e8554f5f1284a78edd0e97
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @effect/cli | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
@kitlangton can you please review?