Skip to content

Conversation

@Masty88
Copy link

@Masty88 Masty88 commented Dec 3, 2025

Type

  • 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 accept originalArgs parameter
  • Fixed SetLogLevel case to preserve paths with spaces when re-executing commands
  • Fixed ShowWizard case 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

@Masty88 Masty88 requested a review from IMax153 as a code owner December 3, 2025 08:06
@github-project-automation github-project-automation bot moved this to Discussion Ongoing in PR Backlog Dec 3, 2025
@changeset-bot
Copy link

changeset-bot bot commented Dec 3, 2025

🦋 Changeset detected

Latest commit: ed1b06a

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

Copy link
Member

@IMax153 IMax153 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to also add @kitlangton for review here.

@IMax153 IMax153 requested a review from kitlangton December 3, 2025 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Discussion Ongoing

Development

Successfully merging this pull request may close these issues.

From Discord: Built-in --log-level option causes argument parsing issues on Windows due to path splitting

2 participants