diff --git a/Scripts/clean-repos.ps1 b/Scripts/clean-repos.ps1 index f647bc7d..c185f691 100755 --- a/Scripts/clean-repos.ps1 +++ b/Scripts/clean-repos.ps1 @@ -16,12 +16,13 @@ try { if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } $Folders = (get-childItem "$ParentDir" -attributes Directory) + $FolderCount = $Folders.Count $ParentDirName = (get-item "$ParentDir").Name - "Found $($Folders.Count) Git repositories in ๐Ÿ“‚$ParentDirName ..." + "Found $FolderCount subfolders in ๐Ÿ“‚$ParentDirName..." foreach ($Folder in $Folders) { $FolderName = (get-item "$Folder").Name - "๐Ÿงน Cleaning ๐Ÿ“‚$FolderName from untracked files..." + "๐Ÿงน Cleaning ๐Ÿ“‚$FolderName from untracked files (#$Step/$FolderCount)..." & git -C "$Folder" clean -xfd -f # force + recurse into dirs + don't use the standard ignore rules if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' failed" } @@ -31,8 +32,7 @@ try { } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "โœ”๏ธ cleaned $($Folders.Count) Git repositories at ๐Ÿ“‚$ParentDirName in $Elapsed sec" - + "โœ”๏ธ cleaned $FolderCount Git repositories at ๐Ÿ“‚$ParentDirName in $Elapsed sec" exit 0 } catch { write-error "โš ๏ธ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" diff --git a/Scripts/pull-repos.ps1 b/Scripts/pull-repos.ps1 index f4e49e75..423231c8 100755 --- a/Scripts/pull-repos.ps1 +++ b/Scripts/pull-repos.ps1 @@ -18,13 +18,13 @@ try { $Folders = (get-childItem "$ParentDir" -attributes Directory) $FolderCount = $Folders.Count $ParentDirName = (get-item "$ParentDir").Name - "Found $FolderCount subfolders under ๐Ÿ“‚$ParentDirName..." + "Found $FolderCount subfolders in ๐Ÿ“‚$ParentDirName..." [int]$Step = 0 foreach ($Folder in $Folders) { $FolderName = (get-item "$Folder").Name $Step++ - "๐Ÿขƒ Pulling #$($Step): ๐Ÿ“‚$FolderName ..." + "๐Ÿขƒ Pulling ๐Ÿ“‚$FolderName (#$Step/$FolderCount)..." & git -C "$Folder" pull --recurse-submodules --jobs=4 if ($lastExitCode -ne "0") { write-warning "'git pull' on ๐Ÿ“‚$FolderName failed" } @@ -34,7 +34,7 @@ try { } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "โœ”๏ธ pulled $FolderCount Git repositories under ๐Ÿ“‚$ParentDirName in $Elapsed sec" + "โœ”๏ธ pulled $FolderCount Git repositories at ๐Ÿ“‚$ParentDirName in $Elapsed sec" exit 0 } catch { write-error "โš ๏ธ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"