Skip to content

Commit 89bdb86

Browse files
committed
fix(owen-ext): gate's outside-checkout check across Windows drives
On windows-latest the checkout is on D: and the temp directory on C:, and os.path.commonpath raises on paths from two drives. Two drives means the consumer is certainly outside the checkout. Gate mechanics only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011ZFvhLx1fM9Gerg4dKsZcL
1 parent 6e65bfb commit 89bdb86

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎scripts/owen_extension_gate.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,11 @@ def isolation(c: Consumer) -> None:
219219
not leaked,
220220
f"on the consumer PATH: {leaked or 'no python/cargo/rustc/owen'}",
221221
)
222-
check(
223-
"E-outside-checkout",
224-
os.path.commonpath([os.path.realpath(c.dir), ROOT]) != ROOT,
225-
"the consumer directory is not inside the Own.NET checkout",
226-
)
222+
try:
223+
inside = os.path.commonpath([os.path.realpath(c.dir), ROOT]) == ROOT
224+
except ValueError: # Windows: different drives, so certainly not inside
225+
inside = False
226+
check("E-outside-checkout", not inside, "the consumer is outside the Own.NET checkout")
227227

228228

229229
def scaffold(c: Consumer) -> None:

0 commit comments

Comments
 (0)