Update clean-branch.ps1

This commit is contained in:
Markus Fleschutz 2021-03-01 12:27:03 +01:00 committed by GitHub
parent 77639425d2
commit 41c83f9ec0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,15 +18,13 @@ try {
try {
write-progress "Cleaning current branch in repository $RepoDir..."
set-location $RepoDir
& git clean -fdx # force + recurse into dirs + don't use the standard ignore rules
if ($lastExitCode -ne "0") { throw "'git clean -fdx' failed" }
& git submodule foreach --recursive git clean -fdx
if ($lastExitCode -ne "0") { throw "'git clean -fdx' in submodules failed" }
& git status
if ($lastExitCode -ne "0") { throw "'git status' failed" }
write-host -foregroundColor green "OK - cleaned current branch in repository $RepoDir"
exit 0
} catch {