From e6d41289f48e9f5d4ea0915a8de8362fbbca21d5 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sun, 31 May 2026 05:45:35 -0700 Subject: [PATCH] Fix WSL UNC setup runner casing --- src/shared/setup-runner-command.test.ts | 13 +++++++++++++ src/shared/setup-runner-command.ts | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 src/shared/setup-runner-command.test.ts diff --git a/src/shared/setup-runner-command.test.ts b/src/shared/setup-runner-command.test.ts new file mode 100644 index 00000000000..3362e890c2b --- /dev/null +++ b/src/shared/setup-runner-command.test.ts @@ -0,0 +1,13 @@ +import { describe, expect, it } from 'vitest' +import { buildSetupRunnerCommand } from './setup-runner-command' + +describe('buildSetupRunnerCommand', () => { + it('uses bash for WSL UNC runner scripts regardless of host casing', () => { + expect( + buildSetupRunnerCommand( + '\\\\WSL.LOCALHOST\\Ubuntu\\home\\jin\\repo\\.git\\worktrees\\feature\\orca\\setup-runner.sh', + 'windows' + ) + ).toBe('bash /home/jin/repo/.git/worktrees/feature/orca/setup-runner.sh') + }) +}) diff --git a/src/shared/setup-runner-command.ts b/src/shared/setup-runner-command.ts index fd7b80184d5..95f12d73724 100644 --- a/src/shared/setup-runner-command.ts +++ b/src/shared/setup-runner-command.ts @@ -20,12 +20,12 @@ export function buildSetupRunnerCommand( function isWslUncPath(path: string): boolean { const normalized = path.replace(/\\/g, '/') - return /^\/\/(wsl\.localhost|wsl\$)\//.test(normalized) + return /^\/\/(wsl\.localhost|wsl\$)\//i.test(normalized) } function wslUncToLinuxPath(windowsPath: string): string { const normalized = windowsPath.replace(/\\/g, '/') - const match = normalized.match(/^\/\/(wsl\.localhost|wsl\$)\/[^/]+(\/.*)?$/) + const match = normalized.match(/^\/\/(wsl\.localhost|wsl\$)\/[^/]+(\/.*)?$/i) return match?.[2] || '/' }