Improve both scripts

This commit is contained in:
Markus Fleschutz 2021-07-02 15:18:40 +02:00
parent b4177e8442
commit 14c4bc562c
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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