mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-22 18:08:18 +02:00
Update clean-repos.ps1
This commit is contained in:
parent
a15e596ce4
commit
135909ecac
@ -26,12 +26,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, cleaning from untracked files..."
|
"Found $FolderCount subfolders in 📂$ParentDirName, cleaning them 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
|
||||||
"⏳ Step $Step/$FolderCount: Cleaning 📂$FolderName..."
|
"⏳ Step $Step/$($FolderCount): Cleaning 📂$FolderName..."
|
||||||
|
|
||||||
& 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" }
|
||||||
|
Loading…
Reference in New Issue
Block a user