Skip to content

Commit

Permalink
Fix $dir parameter passing to Split-PathLikeEnvVar at `strip_path…
Browse files Browse the repository at this point in the history
…` with `-Pattern` switch
  • Loading branch information
Capella87 committed May 2, 2024
1 parent b8580aa commit 7f6f4ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- **json:** Serialize jsonpath return ([#5921](https://github.com/ScoopInstaller/Scoop/issues/5921))
- **scoop-search:** Catch error of parsing invalid manifest ([#5930](https://github.com/ScoopInstaller/Scoop/issues/5930))
- **autoupdate:** Copy `PSCustomObject`-type properties within `autoupdate` to prevent reference changes ([#5934](https://github.com/ScoopInstaller/Scoop/issues/5934))
- **system:** Fix `$dir` parameter passing to `Split-PathLikeEnvVar` at `strip_path` with `-Pattern` switch ([#5936](https://github.com/ScoopInstaller/Scoop/issues/5936))

## [v0.4.1](https://github.com/ScoopInstaller/Scoop/compare/v0.4.0...v0.4.1) - 2024-04-25

Expand Down
5 changes: 4 additions & 1 deletion lib/system.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ function env($name, $global, $val) {

function strip_path($orig_path, $dir) {
Show-DeprecatedWarning $MyInvocation 'Split-PathLikeEnvVar'
Split-PathLikeEnvVar -Name $dir -Path $orig_path
if ($dir -is [string]) {
$dir = @($dir)
}
Split-PathLikeEnvVar -Pattern $dir -Path $orig_path
}

function add_first_in_path($dir, $global) {
Expand Down

0 comments on commit 7f6f4ee

Please sign in to comment.