return from the script after cleanup, if -Clean flag provided (#347)

This commit is contained in:
Engin Polat 2023-09-18 14:59:58 -07:00 коммит произвёл GitHub
Родитель d187d15794
Коммит 5eff568ede
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 3 добавлений и 4 удалений

Просмотреть файл

@ -21,8 +21,7 @@ function Copy-Content ($Content) {
$ErrorActionPreference = 'Stop'
if (-not $PSBoundParameters.ContainsKey("Inline")) {
# Force inlining by env variable, build.ps1 is used in multiple places and passing the $inline everywhere is
# difficult.
# Force inlining by env variable, build.ps1 is used in multiple places and passing the $inline everywhere is difficult.
# Only read this option here. Don't write it.
$Inline = $env:BENCPRESS_BUILD_INLINE -eq "1"
} else {
@ -35,6 +34,7 @@ Get-Module BenchPress | Remove-Module
if ($Clean -and (Test-Path "$PSScriptRoot/bin")) {
Remove-Item "$PSScriptRoot/bin" -Recurse -Force
return
}
$null = New-Item "$PSScriptRoot/bin" -ItemType Directory -Force
@ -83,8 +83,7 @@ if ($Inline) {
$null = $sb.AppendLine("using module $($class.FullName)")
}
# Define this at the top of the module, after the using statements, to skip the code that is wrapped in this if in
# different source files.
# Define this at the top of the module, after the using statements, to skip the code that is wrapped in this if in different source files.
$null = $sb.AppendLine('$BENCHPRESS_BUILD=1')
$functionFiles = $publicFunctions + $privateFunctions