From caa71389a80d42b7d5322ae474e86b2ecb6eeecb Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Fri, 26 Feb 2021 19:25:54 +0100 Subject: [PATCH] Updated clean-branch.ps1 --- Scripts/clean-branch.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Scripts/clean-branch.ps1 b/Scripts/clean-branch.ps1 index feb109d5..fa1a83eb 100755 --- a/Scripts/clean-branch.ps1 +++ b/Scripts/clean-branch.ps1 @@ -1,7 +1,7 @@ #!/bin/powershell <# .SYNTAX ./clean-branch.ps1 -.DESCRIPTION cleans the current Git branch (including submodules) from generated files +.DESCRIPTION cleans the current Git branch including submodules from generated files (e.g. for a fresh build) .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz / License: CC0 #> @@ -14,11 +14,11 @@ try { } try { - & git clean --force -d -x - if ($lastExitCode -ne "0") { throw "'git clean' failed" } + & 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 --force -d -x - if ($lastExitCode -ne "0") { throw "'git clean' in submodules 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" }