Skip to content

Commit 259bbd0

Browse files
committed
Update MyModule.Tests.ps1
1 parent 45a8f16 commit 259bbd0

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

.github/tests/MyModule.Tests.ps1

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,23 @@
33
# --- Helpers ---------------------------------------------------------------
44

55
function Get-RepoRoot {
6-
# Multiple fallback methods for finding the repository root
6+
# Simple approach: try multiple methods to find the repo root
77
$candidates = @()
88

99
# Method 1: From PSScriptRoot (when running from .github/tests)
1010
if ($PSScriptRoot) {
1111
$candidates += (Join-Path $PSScriptRoot '..\..')
1212
}
1313

14-
# Method 2: From PSCommandPath
15-
if ($PSCommandPath) {
16-
$candidates += (Join-Path (Split-Path -Parent $PSCommandPath) '..\..')
17-
}
18-
19-
# Method 3: From current working directory
14+
# Method 2: From current working directory
2015
$candidates += $PWD
2116

22-
# Method 4: From GitHub Actions workspace
17+
# Method 3: From GitHub Actions workspace
2318
if ($env:GITHUB_WORKSPACE) {
2419
$candidates += $env:GITHUB_WORKSPACE
2520
}
2621

27-
# Method 5: Look for Scripts directory in current and parent directories
22+
# Method 4: Look for Scripts directory in current and parent directories
2823
$currentDir = $PWD
2924
for ($i = 0; $i -lt 5; $i++) {
3025
$candidates += $currentDir
@@ -69,6 +64,8 @@ function Test-Syntax([string]$path) {
6964
return ($errors.Count -eq 0)
7065
}
7166

67+
# --- Path Resolution with Debug Output -------------------------------------
68+
7269
$RepoRoot = Get-RepoRoot
7370
$ScriptsDir = Join-Path $RepoRoot 'Scripts'
7471

0 commit comments

Comments
 (0)