From 14c4bc562cd57157a6bfafc0fdf927bc06bbe9ce Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Fri, 2 Jul 2021 15:18:40 +0200 Subject: [PATCH] Improve both scripts --- Scripts/clean-repos.ps1 | 3 +++ Scripts/pull-repos.ps1 | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Scripts/clean-repos.ps1 b/Scripts/clean-repos.ps1 index c185f691..5fb7fa04 100755 --- a/Scripts/clean-repos.ps1 +++ b/Scripts/clean-repos.ps1 @@ -20,6 +20,7 @@ try { $ParentDirName = (get-item "$ParentDir").Name "Found $FolderCount subfolders in ๐Ÿ“‚$ParentDirName..." + [int]$Step = 1 foreach ($Folder in $Folders) { $FolderName = (get-item "$Folder").Name "๐Ÿงน Cleaning ๐Ÿ“‚$FolderName from untracked files (#$Step/$FolderCount)..." @@ -29,6 +30,8 @@ try { & git -C "$Folder" submodule foreach --recursive git clean -xfd -f if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' in submodules failed" } + + $Step++ } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds diff --git a/Scripts/pull-repos.ps1 b/Scripts/pull-repos.ps1 index 423231c8..074c5628 100755 --- a/Scripts/pull-repos.ps1 +++ b/Scripts/pull-repos.ps1 @@ -20,10 +20,9 @@ try { $ParentDirName = (get-item "$ParentDir").Name "Found $FolderCount subfolders in ๐Ÿ“‚$ParentDirName..." - [int]$Step = 0 + [int]$Step = 1 foreach ($Folder in $Folders) { $FolderName = (get-item "$Folder").Name - $Step++ "๐Ÿขƒ Pulling ๐Ÿ“‚$FolderName (#$Step/$FolderCount)..." & git -C "$Folder" pull --recurse-submodules --jobs=4 @@ -31,6 +30,8 @@ try { & git -C "$Folder" submodule update --init --recursive if ($lastExitCode -ne "0") { throw "'git submodule update' failed" } + + $Step++ } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds