Strip duplicate variables and aliases

This commit is contained in:
Manuel Thalmann 2024-08-24 00:08:58 +02:00
parent c908a45eeb
commit e4f3abca2f

View file

@ -26,7 +26,7 @@ $null = New-Module {
Name = "$Name";
Value = "$Value";
} `
".alias |= . + [{ name: env.Name, value: env.Value }]" `
".alias |= [((. // [])[] | select(.name != env.Name))] + [{ name: env.Name, value: env.Value }]" `
-User $User;
}
@ -52,7 +52,7 @@ $null = New-Module {
Name = "$Name";
Value = "$Value";
} `
".env |= . + [{ name: env.Name, value: env.Value }]" `
".env |= [((. // [])[] | select(.name != env.Name))] + [{ name: env.Name, value: env.Value }]" `
-User $User;
}