From 39d17bbf4910a0adb0666fd8ea51c034765310f3 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Mon, 2 May 2022 10:40:19 +0200 Subject: [PATCH] Update fetch-repo.ps1 --- Scripts/fetch-repo.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Scripts/fetch-repo.ps1 b/Scripts/fetch-repo.ps1 index 23f31ba9..e3d51e20 100755 --- a/Scripts/fetch-repo.ps1 +++ b/Scripts/fetch-repo.ps1 @@ -19,18 +19,18 @@ try { $StopWatch = [system.diagnostics.stopwatch]::startNew() "⏳ Step 1/2: Checking requirements... " - & git --version + $null = (git --version) if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } if (-not(Test-Path "$RepoDir" -pathType container)) { throw "Can't access folder: $RepoDir" } - "⏳ Step 2/2: Fetching updates (including submodules)... " + "⏳ Step 2/2: Fetching updates... " & git -C "$RepoDir" fetch --all --recurse-submodules --prune --prune-tags --force if ($lastExitCode -ne "0") { throw "'git fetch' failed with exit code $lastExitCode" } $RepoDirName = (get-item "$RepoDir").Name [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "✔️ fetched updates for repo 📂$RepoDirName in $Elapsed sec" + "✔️ fetched updates for 📂$RepoDirName repo in $Elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"