Add separate method for configuring git

This commit is contained in:
Manuel Thalmann 2024-07-20 04:06:41 +02:00
parent 6274ec1012
commit 7c10903947
2 changed files with 12 additions and 7 deletions

View file

@ -24,6 +24,4 @@ for name in (echo "$users" | jq '.[]' --raw-output0 | string split0)
while ! sudo passwd "$name"
echo "An error occurred! Please try again."
end
source "$dir/../Software/git/main.fish" configure user "$name"
end

View file

@ -3,9 +3,9 @@ begin
set -l dir (status dirname)
source "$(status dirname)/../../Scripts/software.fish"
function configureSW -S -V dir -a scope name
function configureGit -S -V dir -a name
source "$dir/../../Scripts/config.fish"
set -l root
set -l root "valhalla"
set -l user
set -l configArgs
@ -13,12 +13,11 @@ begin
sudo -u "$user" git config $configArgs $argv
end
if [ -z "$scope" ] || [ "$scope" = "system" ]
set root "valhalla"
if [ -z "$user" ]
set user "root"
set configArgs "--system"
else
set root "valhalla.users.$name"
set root "$root.users.$name"
set user "$name"
set configArgs "--global"
set -l displayName "$root.displayName"
@ -82,5 +81,13 @@ begin
end
end
function configureSW -S -V dir
configureGit
end
function userConfig -S -V dir -a name
configureGit "$name"
end
runInstaller $argv
end