From 2ec537cd64a3e0102e544537e4387117b2fe96cd Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Wed, 31 Aug 2022 09:06:20 +0200 Subject: [PATCH] Update fetch-repos.ps1 and pull-repos.ps1 --- Scripts/fetch-repos.ps1 | 8 ++++---- Scripts/pull-repos.ps1 | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Scripts/fetch-repos.ps1 b/Scripts/fetch-repos.ps1 index 52d2898e..fa7ff797 100755 --- a/Scripts/fetch-repos.ps1 +++ b/Scripts/fetch-repos.ps1 @@ -23,7 +23,7 @@ try { if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } $ParentDirName = (Get-Item "$ParentDir").Name - "⏳ Step 2 - Checking parent folder 📂$ParentDirName..." + "⏳ Step 2 - Checking folder 📂$ParentDirName..." if (-not(Test-Path "$ParentDir" -pathType container)) { throw "Can't access folder: $ParentDir" } $Folders = (Get-ChildItem "$ParentDir" -attributes Directory) $NumFolders = $Folders.Count @@ -31,8 +31,8 @@ try { [int]$Step = 3 foreach ($Folder in $Folders) { - $FolderName = (get-item "$Folder").Name - "⏳ Step $Step/$($NumFolders + 2) - Fetching 📂$FolderName..." + $FolderName = (Get-Item "$Folder").Name + "⏳ Step $Step/$($NumFolders + 2) - Fetching into 📂$FolderName..." & git -C "$Folder" fetch --all --recurse-submodules --prune --prune-tags --force if ($lastExitCode -ne "0") { throw "'git fetch' in $FolderName failed" } @@ -41,7 +41,7 @@ try { } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "✔️ fetched $NumFolders Git repositories at 📂$ParentDirName in $Elapsed sec" + "✔️ fetched $NumFolders Git repos at 📂$ParentDirName in $Elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" diff --git a/Scripts/pull-repos.ps1 b/Scripts/pull-repos.ps1 index 41885c7f..c9c6fdd9 100755 --- a/Scripts/pull-repos.ps1 +++ b/Scripts/pull-repos.ps1 @@ -23,7 +23,7 @@ try { if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } $ParentDirName = (Get-Item "$ParentDir").Name - "⏳ Step 2 - Checking parent folder 📂$ParentDirName..." + "⏳ Step 2 - Checking folder 📂$ParentDirName..." if (-not(Test-Path "$ParentDir" -pathType container)) { throw "Can't access folder: $ParentDir" } $Folders = (Get-ChildItem "$ParentDir" -attributes Directory) $NumFolders = $Folders.Count @@ -32,8 +32,8 @@ try { [int]$Step = 3 [int]$Failed = 0 foreach ($Folder in $Folders) { - $FolderName = (get-item "$Folder").Name - "⏳ Step $Step/$($NumFolders + 2) - Pulling 📂$FolderName... " + $FolderName = (Get-Item "$Folder").Name + "⏳ Step $Step/$($NumFolders + 2) - Pulling into 📂$FolderName... " & git -C "$Folder" pull --recurse-submodules --jobs=4 if ($lastExitCode -ne "0") { $Failed++; write-warning "'git pull' in 📂$FolderName failed" } @@ -45,9 +45,9 @@ try { } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "✔️ pulled $NumFolders repos in 📂$ParentDirName in $Elapsed sec ($Failed failed)" + "✔️ pulled $NumFolders Git repos at 📂$ParentDirName in $Elapsed sec ($Failed failed)" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" exit 1 -} +} \ No newline at end of file