mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-22 01:48:20 +02:00
Improve output of both scripts
This commit is contained in:
parent
8733e87c4c
commit
1995c56a2a
@ -18,12 +18,12 @@ try {
|
|||||||
$Folders = (get-childItem "$ParentDir" -attributes Directory)
|
$Folders = (get-childItem "$ParentDir" -attributes Directory)
|
||||||
$FolderCount = $Folders.Count
|
$FolderCount = $Folders.Count
|
||||||
$ParentDirName = (get-item "$ParentDir").Name
|
$ParentDirName = (get-item "$ParentDir").Name
|
||||||
"Found $FolderCount subfolders in 📂$ParentDirName..."
|
"Found $FolderCount subfolders in 📂$ParentDirName, cleaning from untracked files..."
|
||||||
|
|
||||||
[int]$Step = 1
|
[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 ($Step/$FolderCount)..."
|
||||||
|
|
||||||
& git -C "$Folder" clean -xfd -f # force + recurse into dirs + don't use the standard ignore rules
|
& 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" }
|
if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' failed" }
|
||||||
|
@ -23,7 +23,7 @@ try {
|
|||||||
[int]$Step = 1
|
[int]$Step = 1
|
||||||
foreach ($Folder in $Folders) {
|
foreach ($Folder in $Folders) {
|
||||||
$FolderName = (get-item "$Folder").Name
|
$FolderName = (get-item "$Folder").Name
|
||||||
"🢃 Pulling 📂$FolderName (#$Step/$FolderCount)..."
|
"🢃 Pulling 📂$FolderName ($Step/$FolderCount)..."
|
||||||
|
|
||||||
& git -C "$Folder" pull --recurse-submodules --jobs=4
|
& git -C "$Folder" pull --recurse-submodules --jobs=4
|
||||||
if ($lastExitCode -ne "0") { write-warning "'git pull' on 📂$FolderName failed" }
|
if ($lastExitCode -ne "0") { write-warning "'git pull' on 📂$FolderName failed" }
|
||||||
|
Loading…
Reference in New Issue
Block a user