mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-24 02:48:17 +02:00
Update new-branch.ps1
This commit is contained in:
parent
4645661788
commit
348403a3ba
@ -25,7 +25,7 @@ try {
|
|||||||
"⏳ Step 1/5: Checking requirements... "
|
"⏳ Step 1/5: Checking requirements... "
|
||||||
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
|
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
|
||||||
|
|
||||||
& git --version
|
$null = (git --version)
|
||||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||||
|
|
||||||
"⏳ Step 2/5: Fetching updates..."
|
"⏳ Step 2/5: Fetching updates..."
|
||||||
@ -49,7 +49,7 @@ try {
|
|||||||
|
|
||||||
$RepoDirName = (get-item "$RepoDir").Name
|
$RepoDirName = (get-item "$RepoDir").Name
|
||||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
"✔️ created new '$NewBranchName' branch in repo 📂$RepoDirName based on '$CurrentBranchName' branch in $Elapsed sec"
|
"✔️ new '$NewBranchName' branch created in 📂$RepoDirName repo based on '$CurrentBranchName' branch in $Elapsed sec"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user