fix(system): $dir parameter passing to Split-PathLikeEnvVar at strip_path with -Pattern switch#5937
Merged
niheaven merged 3 commits intoScoopInstaller:developfrom May 6, 2024
Merged
Conversation
$dir parameter passing to Split-PathLikeEnvVar at strip_path with -Pattern switch$dir parameter passing to Split-PathLikeEnvVar at strip_path with -Pattern switch
$dir parameter passing to Split-PathLikeEnvVar at strip_path with -Pattern switch$dir parameter passing to Split-PathLikeEnvVar at strip_path with -Pattern switch
…trip_path` with `-Pattern` switch
niheaven
reviewed
May 5, 2024
Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
Update the title to the suggested one. Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
Contributor
Author
|
I've added commits by your suggestions. Thank you! I am wondering if I could ask you a question? I've made changes in several manifests to remove deprecated functions including |
Member
|
Yes, of cause. Please make one PR for all manifests. |
1 task
niheaven
added a commit
that referenced
this pull request
May 13, 2024
…ecated `strip_path()` (#5937) Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
niheaven
added a commit
that referenced
this pull request
May 13, 2024
…ecated `strip_path()` (#5937) Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
brian6932
pushed a commit
to brian6932/Scoop
that referenced
this pull request
Jun 1, 2024
…ecated `strip_path()` (ScoopInstaller#5937) Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Correct parameter's name,
-Nameto-Pattern. Corresponds to the new parameter name -Pattern for theSplit-PathLikeEnvVarfunction.Motivation and Context
Function
Test-PathLikeEnvVaris changed toSplit-PathLikeEnvVarrecently, which also updated to provide-Patternparameter with string array type to the function. Butstrip_path, which is now deprecated function and implemented to invoke warning andSplit-PathLikeEnvVarfunction with$dirand$orig_pathparameters, is still passing$dirparameter as-Nameto the newer function. So$Patternhas$nullvalue and causes null-valued expression error.As we can see, the function could not receive the value to
$Patterncorrectly.The error was that:
I discovered this issue when I invoked
scoop update *to try to update SDL2, null-valued expression errors were occurred.I fixed
split_pathfunction to pass the parameter as-Patterncorrectly. Moreover, add casting related code, that's becauseSplit-PathLikeEnvVarrequires$Patternas a string array, not a single string, It would be better to explicitly change$dirto an array.I believe that we can troubleshoot this problem by updating
strip_pathfunction for now, we should also update manifests not to use deprecated functions like this ultimately.Before:
After:
How Has This Been Tested?
Tested on both Windows 10 (22H2) and Windows 11(23H2)
Checklist:
developbranch.