Repository navigation
fix(settings): split path lists on the OS separator in the CLI #12012
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jdx
merged 1 commit into
jdx:main
from
JamBalaya56562:fix/settings-set-os-path-separator
Aug 15, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| Describe 'mise settings set with a path list' { | ||
| BeforeAll { | ||
| $script:OriginalDir = Get-Location | ||
| # Saved here, restored in AfterAll: Pester runs every suite in one process, so removing an | ||
| # inherited value would leave the next suite without it. | ||
| $script:OriginalTrusted = [Environment]::GetEnvironmentVariable('MISE_TRUSTED_CONFIG_PATHS', 'Process') | ||
| $script:TestRoot = Join-Path $TestDrive ([System.Guid]::NewGuid().ToString()) | ||
| New-Item -ItemType Directory -Path $script:TestRoot | Out-Null | ||
| $env:MISE_TRUSTED_CONFIG_PATHS = $script:TestRoot | ||
| $script:ConfigPath = Join-Path $script:TestRoot "mise.toml" | ||
|
|
||
| # Counting `C:\` distinguishes the two behaviours without depending on how toml_edit | ||
| # quotes a string: the colon split severed every drive letter from its path, so the | ||
| # broken output held a bare `C` entry and no `C:\` at all. | ||
| function Get-DriveRootedCount { | ||
| $written = Get-Content $script:ConfigPath | Out-String | ||
| ([regex]::Matches($written, [regex]::Escape('C:\'))).Count | ||
| } | ||
| } | ||
|
|
||
| AfterAll { | ||
| Set-Location $script:OriginalDir | ||
| if ($null -eq $script:OriginalTrusted) { | ||
| Remove-Item Env:MISE_TRUSTED_CONFIG_PATHS -ErrorAction Ignore | ||
| } else { | ||
| [Environment]::SetEnvironmentVariable('MISE_TRUSTED_CONFIG_PATHS', $script:OriginalTrusted, 'Process') | ||
| } | ||
| } | ||
|
|
||
| BeforeEach { | ||
| # `task.disable_paths` rather than `trusted_config_paths`, which is global_only: --local | ||
| # would not apply to it and the write would land in the real user config. | ||
| Set-Location $script:TestRoot | ||
| "[tools]" | Out-File -Encoding ascii $script:ConfigPath | ||
| } | ||
|
|
||
| It 'keeps a lone path whole' { | ||
| # No list separator anywhere, and it still came apart before: the drive letter's colon | ||
| # is not a separator. | ||
| mise settings set --local task.disable_paths 'C:\one' | ||
| Get-DriveRootedCount | Should -Be 1 | ||
| (mise settings get task.disable_paths | Out-String) | Should -Match ([regex]::Escape('C:\one')) | ||
| } | ||
|
|
||
| It 'splits on the semicolon rather than the drive letter' { | ||
| mise settings set --local task.disable_paths 'C:\one;C:\two' | ||
| Get-DriveRootedCount | Should -Be 2 | ||
| $got = mise settings get task.disable_paths | Out-String | ||
| $got | Should -Match ([regex]::Escape('C:\one')) | ||
| $got | Should -Match ([regex]::Escape('C:\two')) | ||
| } | ||
|
|
||
| It 'appends without severing the path when adding' { | ||
| # `mise settings add` reaches the same parser, so it carried the same defect. | ||
| mise settings set --local task.disable_paths 'C:\one' | ||
| mise settings add --local task.disable_paths 'C:\two' | ||
| Get-DriveRootedCount | Should -Be 2 | ||
| $got = mise settings get task.disable_paths | Out-String | ||
| $got | Should -Match ([regex]::Escape('C:\one')) | ||
| $got | Should -Match ([regex]::Escape('C:\two')) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.