From 0c50ee42d5bce931edfdda1e22f6a93a9e46eb48 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Wed, 21 Apr 2021 12:05:53 +0200 Subject: [PATCH] Improve output of build-repo.ps1 --- Scripts/build-repo.ps1 | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Scripts/build-repo.ps1 b/Scripts/build-repo.ps1 index cfaf7fca..79772f08 100755 --- a/Scripts/build-repo.ps1 +++ b/Scripts/build-repo.ps1 @@ -11,8 +11,11 @@ param($RepoDir = "$PWD") try { $StopWatch = [system.diagnostics.stopwatch]::startNew() + $RepoDir = resolve-path -path "$RepoDir" -relative + if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" } + if (test-path "$RepoDir/CMakeLists.txt") { - "⏳ Building $RepoDir using CMakeLists.txt..." + "⏳ Building 📂$RepoDir using CMakeLists.txt ..." if (-not(test-path "$RepoDir/CMakeBuild")) { & mkdir "$RepoDir/CMakeBuild/" } @@ -25,7 +28,7 @@ try { if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" } } elseif (test-path "$RepoDir/configure") { - "⏳ Building $RepoDir using 'configure'..." + "⏳ Building 📂$RepoDir using 'configure' ..." set-location "$RepoDir/" & ./configure @@ -35,7 +38,7 @@ try { if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" } } elseif (test-path "$RepoDir/autogen.sh") { - "⏳ Building $RepoDir using 'autogen.sh'..." + "⏳ Building 📂$RepoDir using 'autogen.sh' ..." set-location "$RepoDir/" & ./autogen.sh @@ -45,7 +48,7 @@ try { if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" } } elseif (test-path "$RepoDir/Imakefile") { - "⏳ Building $RepoDir using Imakefile..." + "⏳ Building 📂$RepoDir using Imakefile ..." set-location "$RepoDir/" & xmkmf @@ -55,25 +58,25 @@ try { if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" } } elseif (test-path "$RepoDir/Makefile") { - "⏳ Building $RepoDir using Makefile..." + "⏳ Building 📂$RepoDir using Makefile..." set-location "$RepoDir/" & make -j4 if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" } } elseif (test-path "$RepoDir/attower/src/build/DevBuild/build.bat") { - "⏳ Building $RepoDir using build.bat..." + "⏳ Building 📂$RepoDir using build.bat ..." set-location "$RepoDir/attower/src/build/DevBuild/" & ./build.bat build-all-release if ($lastExitCode -ne "0") { throw "Script 'build.bat' returned error(s)" } } else { - write-warning "Sorry, no rule found to build $RepoDir" + write-warning "Sorry, no rule found to build 📂$RepoDir" exit 0 } - write-host -foregroundColor green "✔️ Git repository $RepoDir built in $($StopWatch.Elapsed.Seconds) second(s)" + "✔️ built Git repository 📂$RepoDir in $($StopWatch.Elapsed.Seconds) second(s)" exit 0 } catch { write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"