Add separate method for configuring git
This commit is contained in:
parent
a89d9bb677
commit
3a4c2891ad
2 changed files with 12 additions and 7 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue