Separate global and OS-specific config

This commit is contained in:
Manuel Thalmann 2024-09-22 17:50:05 +02:00
parent 4fe88bba12
commit d0b055140e
15 changed files with 101 additions and 61 deletions
scripts/Common/Software/git

View file

@ -17,18 +17,19 @@ param (
[string] $User
)
$root = "valhalla";
$getConfig = $null;
if ($User) {
$root = "$root$($IsWindows ? ".windows" : '').users.$User";
$getConfig = { Get-UserConfig -UserName $User @args };
$sudoArgs = @("-u", $User);
$configArgs = @("--global");
} else {
$getConfig = { Get-OSConfig @args };
$sudoArgs = @();
$configArgs = @("--system");
}
$config = Get-Config "$root.git";
$config = & $getConfig "git";
<#
.SYNOPSIS