Skip to content

Commit 1ffbf28

Browse files
Reorder settings file validation to improve script flow
1 parent a2b93ad commit 1ffbf28

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/main.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ $path = [string]::IsNullOrEmpty($env:PSMODULE_INVOKE_SCRIPTANALYZER_INPUT_Path)
44
$codePath = Resolve-Path -Path $path | Select-Object -ExpandProperty Path
55
$settingsFilePath = Join-Path -Path $codePath -ChildPath $env:PSMODULE_INVOKE_SCRIPTANALYZER_INPUT_SettingsFilePath
66

7-
if (!(Test-Path -Path $settingsFilePath)) {
8-
Write-Error "Settings file not found at path: $settingsFilePath"
9-
exit 1
10-
}
11-
127
[pscustomobject]@{
138
CodePath = $codePath
149
TestPath = $testPath
1510
SettingsFilePath = $settingsFilePath
1611
} | Format-List | Out-String
1712

13+
if (!(Test-Path -Path $settingsFilePath)) {
14+
Write-Error "Settings file not found at path: $settingsFilePath"
15+
exit 1
16+
}
17+
1818
Set-GitHubOutput -Name CodePath -Value $codePath
1919
Set-GitHubOutput -Name TestPath -Value $testPath
2020
Set-GitHubOutput -Name SettingsFilePath -Value $settingsFilePath

0 commit comments

Comments
 (0)