Skip to content

Commit 1166b5b

Browse files
🪲 [Fix]: Fix Path resolution logic (#20)
## Description This pull request includes a change to the `scripts/init.ps1` file to improve the handling of input paths in the `Init - Load inputs` log group. ### Improvements to input path handling * `scripts/init.ps1`: Modified the `Resolve-Path` command to use a default path of `'.'` if the environment variable `PSMODULE_INVOKE_PESTER_INPUT_Path` is empty. This ensures that the script can handle cases where the input path is not provided. ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent 0601fa2 commit 1166b5b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

scripts/init.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ LogGroup 'Init - Get test kit versions' {
1919
}
2020

2121
LogGroup 'Init - Load inputs' {
22-
$providedItem = Resolve-Path -Path "./$env:PSMODULE_INVOKE_PESTER_INPUT_Path" | Select-Object -ExpandProperty Path | Get-Item
22+
$path = [string]::IsNullOrEmpty($env:PSMODULE_INVOKE_PESTER_INPUT_Path) ? '.' : $env:PSMODULE_INVOKE_PESTER_INPUT_Path
23+
$providedItem = Resolve-Path -Path $path | Select-Object -ExpandProperty Path | Get-Item
2324
if ($providedItem -is [System.IO.DirectoryInfo]) {
2425
$providedPath = $providedItem.FullName
2526
} elseif ($providedItem -is [System.IO.FileInfo]) {

0 commit comments

Comments
 (0)