Skip to content

Commit 1709e73

Browse files
committed
Update fetch-repo.ps1
1 parent b566599 commit 1709e73

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Scripts/fetch-repo.ps1

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,18 @@ param([string]$RepoDir = "$PWD")
1818
try {
1919
$StopWatch = [system.diagnostics.stopwatch]::startNew()
2020

21-
"⏳ Step 1/2: Checking requirements... "
22-
$null = (git --version)
21+
"⏳ Step 1/3 - Searching for Git executable... "
22+
& git --version
2323
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
2424

25-
if (-not(Test-Path "$RepoDir" -pathType container)) { throw "Can't access folder: $RepoDir" }
25+
$RepoDirName = (Get-Item "$RepoDir").Name
26+
"⏳ Step 2/3 - Checking folder 📂$RepoDirName... "
27+
if (!(Test-Path "$RepoDir" -pathType container)) { throw "Can't access folder: $RepoDir" }
2628

27-
"⏳ Step 2/2: Fetching updates... "
29+
"⏳ Step 3/3 - Fetching updates... "
2830
& git -C "$RepoDir" fetch --all --recurse-submodules --prune --prune-tags --force
2931
if ($lastExitCode -ne "0") { throw "'git fetch' failed with exit code $lastExitCode" }
3032

31-
$RepoDirName = (get-item "$RepoDir").Name
3233
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
3334
"✔️ fetched updates for 📂$RepoDirName repo in $Elapsed sec"
3435
exit 0 # success

0 commit comments

Comments
 (0)