mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-22 16:03:22 +01:00
Improve both scripts
This commit is contained in:
parent
b4177e8442
commit
14c4bc562c
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user