From 8328c1d14f909b5205da10fac33c330f58ba9ece Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Mon, 29 Aug 2022 11:34:30 +0200 Subject: [PATCH] Update configure-git.ps1 --- Scripts/configure-git.ps1 | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Scripts/configure-git.ps1 b/Scripts/configure-git.ps1 index e5657f92..c23a051e 100755 --- a/Scripts/configure-git.ps1 +++ b/Scripts/configure-git.ps1 @@ -1,4 +1,4 @@ -<# +<# .SYNOPSIS Configures Git .DESCRIPTION @@ -20,16 +20,18 @@ param([string]$FullName = "", [string]$EmailAddress = "", [string]$FavoriteEditor = "") try { + $StopWatch = [system.diagnostics.stopwatch]::startNew() + + "⏳ Step 1/4 - Searching for Git executable..." + & git --version + if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } + + "⏳ Step 2/4 - Input details..." if ($FullName -eq "") { $FullName = read-host "Enter your full name" } if ($EmailAddress -eq "") { $EmailAddress = read-host "Enter your e-mail address"} if ($FavoriteEditor -eq "") { $FavoriteEditor = read-host "Enter your favorite text editor (emacs,nano,vi,vim,...)" } - $StopWatch = [system.diagnostics.stopwatch]::startNew() - "⏳ Step 1/3: Searching for Git executable..." - & git --version - if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } - - "⏳ Step 2/3: Configuring basic settings..." + "⏳ Step 3/4 - Saving basic settings (name,email,editor,symlinks,etc.)..." & git config --global user.name $FullName & git config --global user.email $EmailAddress & git config --global core.editor $FavoriteEditor @@ -42,7 +44,7 @@ try { & git config --global pull.rebase false if ($lastExitCode -ne "0") { throw "'git config' failed with exit code $lastExitCode" } - "⏳ Step 3/3: Adding basic shortcuts (git st, git ls, etc.)..." + "⏳ Step 4/4 - Saving basic shortcuts (co,br,ci,st,pl,ps,mrg,chp,ls,smu)..." & git config --global alias.co "checkout" & git config --global alias.br "branch" & git config --global alias.ci "commit" @@ -56,7 +58,7 @@ try { if ($lastExitCode -ne "0") { throw "'git config' failed" } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "✔️ saved your personal Git configuration in $Elapsed sec, it's now:" + "✔️ saved your Git configuration in $Elapsed sec, it's now:" & git config --list if ($lastExitCode -ne "0") { throw "'git config --list' failed with exit code $lastExitCode" }