From 69b9544a2151a79e04bcc648dc53e6da39be4f89 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Tue, 8 Mar 2022 11:01:01 +0100 Subject: [PATCH] Update switch-branch.ps1 --- Scripts/switch-branch.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Scripts/switch-branch.ps1 b/Scripts/switch-branch.ps1 index a6499607..275426ac 100755 --- a/Scripts/switch-branch.ps1 +++ b/Scripts/switch-branch.ps1 @@ -19,6 +19,7 @@ param([string]$BranchName = "", [string]$RepoDir = "$PWD") try { if ($BranchName -eq "") { $BranchName = read-host "Enter name of branch to switch to" } + if ($RepoDir -eq "") { $RepoDir = read-host "Enter path to the Git repository" } $StopWatch = [system.diagnostics.stopwatch]::startNew() @@ -52,7 +53,7 @@ try { $RepoDirName = (get-item "$RepoDir").Name [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "✔️ switched Git repository 📂$RepoDirName to $BranchName branch in $Elapsed sec" + "✔️ switched Git repo 📂$RepoDirName to $BranchName branch in $Elapsed sec" exit 0 # success } catch { "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"