mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-23 02:18:21 +02:00
Improve both scripts
This commit is contained in:
parent
b4177e8442
commit
14c4bc562c
@ -20,6 +20,7 @@ try {
|
|||||||
$ParentDirName = (get-item "$ParentDir").Name
|
$ParentDirName = (get-item "$ParentDir").Name
|
||||||
"Found $FolderCount subfolders in 📂$ParentDirName..."
|
"Found $FolderCount subfolders in 📂$ParentDirName..."
|
||||||
|
|
||||||
|
[int]$Step = 1
|
||||||
foreach ($Folder in $Folders) {
|
foreach ($Folder in $Folders) {
|
||||||
$FolderName = (get-item "$Folder").Name
|
$FolderName = (get-item "$Folder").Name
|
||||||
"🧹 Cleaning 📂$FolderName from untracked files (#$Step/$FolderCount)..."
|
"🧹 Cleaning 📂$FolderName from untracked files (#$Step/$FolderCount)..."
|
||||||
@ -29,6 +30,8 @@ try {
|
|||||||
|
|
||||||
& git -C "$Folder" submodule foreach --recursive git clean -xfd -f
|
& git -C "$Folder" submodule foreach --recursive git clean -xfd -f
|
||||||
if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' in submodules failed" }
|
if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' in submodules failed" }
|
||||||
|
|
||||||
|
$Step++
|
||||||
}
|
}
|
||||||
|
|
||||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
|
@ -20,10 +20,9 @@ try {
|
|||||||
$ParentDirName = (get-item "$ParentDir").Name
|
$ParentDirName = (get-item "$ParentDir").Name
|
||||||
"Found $FolderCount subfolders in 📂$ParentDirName..."
|
"Found $FolderCount subfolders in 📂$ParentDirName..."
|
||||||
|
|
||||||
[int]$Step = 0
|
[int]$Step = 1
|
||||||
foreach ($Folder in $Folders) {
|
foreach ($Folder in $Folders) {
|
||||||
$FolderName = (get-item "$Folder").Name
|
$FolderName = (get-item "$Folder").Name
|
||||||
$Step++
|
|
||||||
"🢃 Pulling 📂$FolderName (#$Step/$FolderCount)..."
|
"🢃 Pulling 📂$FolderName (#$Step/$FolderCount)..."
|
||||||
|
|
||||||
& git -C "$Folder" pull --recurse-submodules --jobs=4
|
& git -C "$Folder" pull --recurse-submodules --jobs=4
|
||||||
@ -31,6 +30,8 @@ try {
|
|||||||
|
|
||||||
& git -C "$Folder" submodule update --init --recursive
|
& git -C "$Folder" submodule update --init --recursive
|
||||||
if ($lastExitCode -ne "0") { throw "'git submodule update' failed" }
|
if ($lastExitCode -ne "0") { throw "'git submodule update' failed" }
|
||||||
|
|
||||||
|
$Step++
|
||||||
}
|
}
|
||||||
|
|
||||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
|
Loading…
Reference in New Issue
Block a user