Improve the scripts

This commit is contained in:
Markus Fleschutz
2021-04-17 18:54:45 +02:00
parent 9aa997ebf5
commit f78a9390cb
9 changed files with 15 additions and 20 deletions

View File

@ -9,7 +9,8 @@
param($RepoDir = "$PWD")
try {
"⏳ Cleaning Git repository $RepoDir from untracked files..."
$RepoDir = resolve-path "$RepoDir/"
"⏳ Cleaning $RepoDir from untracked files..."
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
set-location "$RepoDir"
@ -23,7 +24,7 @@ try {
& git submodule foreach --recursive git clean -fdx
if ($lastExitCode -ne "0") { throw "'git clean -fdx' in submodules failed" }
write-host -foregroundColor green "✔️ Git repository $RepoDir is clean"
"📂 $RepoDir is clean"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"