mirror of
https://github.com/stablyai/orca.git
synced 2026-10-15 08:03:08 +00:00
Fix WSL UNC setup runner casing
This commit is contained in:
@@ -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')
|
||||
})
|
||||
})
|
||||
@@ -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] || '/'
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user