mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-05 16:14:42 +02:00
Add extra -f to git clean
This commit is contained in:
parent
38b2cabfd1
commit
95e654ceec
@ -18,11 +18,11 @@ try {
|
|||||||
$Null = (git --version)
|
$Null = (git --version)
|
||||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||||
|
|
||||||
& git -C "$RepoDir" clean -fdx # force + recurse into dirs + don't use the standard ignore rules
|
& git -C "$RepoDir" clean -xfd -f # force + recurse into dirs + don't use the standard ignore rules
|
||||||
if ($lastExitCode -ne "0") { throw "'git clean -fdx' failed" }
|
if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' failed" }
|
||||||
|
|
||||||
& git -C "$RepoDir" submodule foreach --recursive git clean -fdx
|
& git -C "$RepoDir" submodule foreach --recursive git clean -xfd -f
|
||||||
if ($lastExitCode -ne "0") { throw "'git clean -fdx' in submodules failed" }
|
if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' in submodules failed" }
|
||||||
|
|
||||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
"✔️ cleaned Git repository 📂$RepoDirName in $Elapsed sec"
|
"✔️ cleaned Git repository 📂$RepoDirName in $Elapsed sec"
|
||||||
|
@ -23,11 +23,11 @@ try {
|
|||||||
$FolderName = (get-item "$Folder").Name
|
$FolderName = (get-item "$Folder").Name
|
||||||
"🧹 Cleaning 📂$FolderName ..."
|
"🧹 Cleaning 📂$FolderName ..."
|
||||||
|
|
||||||
& git -C "$Folder" clean -fdx # 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 -fdx' failed" }
|
if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' failed" }
|
||||||
|
|
||||||
& git -C "$Folder" submodule foreach --recursive git clean -fdx
|
& git -C "$Folder" submodule foreach --recursive git clean -xfd -f
|
||||||
if ($lastExitCode -ne "0") { throw "'git clean -fdx' in submodules failed" }
|
if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' in submodules failed" }
|
||||||
}
|
}
|
||||||
|
|
||||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
|
Loading…
Reference in New Issue
Block a user