Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Tests/test-local.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@ $Failures = New-Object System.Collections.Generic.List[string]
# Restored before the script exits.
$SavedModulePath = $env:PSModulePath
$RequiredModulesPath = Join-Path $RepoRoot 'output/RequiredModules'
if ((Test-Path $RequiredModulesPath) -and ($env:PSModulePath -notlike "*$RequiredModulesPath*")) {
$env:PSModulePath = $RequiredModulesPath + [IO.Path]::PathSeparator + $env:PSModulePath
function Add-RequiredModulesPath {
if ((Test-Path $RequiredModulesPath) -and ($env:PSModulePath -notlike "*$RequiredModulesPath*")) {
$env:PSModulePath = $RequiredModulesPath + [IO.Path]::PathSeparator + $env:PSModulePath
}
}
Add-RequiredModulesPath

function Write-Stage([string]$Name) {
Write-Host ''
Expand Down Expand Up @@ -99,6 +102,9 @@ if ($Stage -contains 'Build') {
& (Get-Process -Id $PID).Path @BuildArgs
if ($LASTEXITCODE -ne 0) { $Failures.Add("Build: build.ps1 exited with $LASTEXITCODE") }
$env:ModuleVersion = $SavedBuildVersion
# On a clean checkout the build has only just created output/RequiredModules; the later stages need it
# (the release workflow runs every stage in one call on a runner that has no platyPS).
Add-RequiredModulesPath
}
}

Expand Down
Loading