Conversation
Also enclose shim content with @()
|
@rashil2000 Could you please check enclosed code? I do this carefully and think they haven't changed 😄 It's only refactoring and makes them look prettier. |
|
Only one minor thing: Some places use |
rashil2000
left a comment
There was a problem hiding this comment.
Changes to bash shim due to #4616
Well, the two different quotes are introduced by PowerShell formatter, I'll change them all to |
Close #4616 Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>
|
It should be done. |
|
@rashil2000 Could you please add some tests for newly added shims? e.g., |
|
Sure! But I have never written tests for PowerShell before. Could you point at some examples in the codebase I can look at? |
…staller#4614) Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>
Description
Fix PS1 shim's content switch, change from
^(.\\[\w]:).*$to^(\.\\)?\w:.*$. Also enclose shim content with @() for a clear look.Motivation and Context
PS1 shim went wrong in PowerShell 7 if target is in a different drive other than shim dir. This is introduced by
Resolve-Path -Relativecmdlet's output.In PS5:

In PS7:

Other changes are pure refactoring (enclosed raw code in
@())How Has This Been Tested?
Run
Invoke-Pester ".\test\Scoop-Core.Tests.ps1"Before:

After:

Checklist: