From b73b4522b2fe0649ba15c0e90f4324ecbaa16713 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Fri, 23 Aug 2024 02:01:16 +0200 Subject: [PATCH] Set user info during `git` setup --- scripts/Common/Software/git/Manage.ps1 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/Common/Software/git/Manage.ps1 b/scripts/Common/Software/git/Manage.ps1 index c9b605e2..5e782957 100644 --- a/scripts/Common/Software/git/Manage.ps1 +++ b/scripts/Common/Software/git/Manage.ps1 @@ -59,6 +59,19 @@ $null = New-Module { } } + if ($User) { + $displayName = & $getConfig "displayName"; + $mailAddress = & $getConfig "mailAddress"; + + if ($displayName) { + Set-GitConfig "user.name" $displayName; + } + + if ($mailAddress) { + Set-GitConfig "user.email" $mailAddress; + } + } + # Git Flow . { $dir = New-TemporaryDirectory;