-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix(system): $dir
parameter passing to Split-PathLikeEnvVar
at strip_path
with -Pattern
switch
#5937
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
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>
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 |
Yes, of cause. Please make one PR for all manifests. |
…ecated `strip_path()` (#5937) Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
…ecated `strip_path()` (#5937) Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
…ecated `strip_path()` (ScoopInstaller#5937) Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
Description
Correct parameter's name,
-Name
to-Pattern
. Corresponds to the new parameter name -Pattern for theSplit-PathLikeEnvVar
function.Motivation and Context
Function
Test-PathLikeEnvVar
is changed toSplit-PathLikeEnvVar
recently, which also updated to provide-Pattern
parameter with string array type to the function. Butstrip_path
, which is now deprecated function and implemented to invoke warning andSplit-PathLikeEnvVar
function with$dir
and$orig_path
parameters, is still passing$dir
parameter as-Name
to the newer function. So$Pattern
has$null
value and causes null-valued expression error.As we can see, the function could not receive the value to
$Pattern
correctly.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_path
function to pass the parameter as-Pattern
correctly. Moreover, add casting related code, that's becauseSplit-PathLikeEnvVar
requires$Pattern
as a string array, not a single string, It would be better to explicitly change$dir
to an array.I believe that we can troubleshoot this problem by updating
strip_path
function 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:
develop
branch.