mirror of
https://github.com/stablyai/orca.git
synced 2026-09-30 08:03:12 +00:00
Fix Windows setup hook script (#2106)
This commit is contained in:
@@ -185,33 +185,45 @@ describe('createIssueCommandRunnerScript', () => {
|
||||
|
||||
it('writes a POSIX runner under the worktree git dir for long issue commands', async () => {
|
||||
const fs = await import('fs')
|
||||
const originalPlatform = process.platform
|
||||
|
||||
execFileSyncMock.mockReturnValue(
|
||||
'/test/repo/.git/worktrees/feature/orca/issue-command-runner.sh'
|
||||
)
|
||||
|
||||
const { createIssueCommandRunnerScript } = await import('./hooks')
|
||||
const result = createIssueCommandRunnerScript(
|
||||
makeRepo(),
|
||||
'/test/repo-feature',
|
||||
'codex exec "long command"\nclaude -p "review it"'
|
||||
)
|
||||
|
||||
expect(result).toEqual({
|
||||
runnerScriptPath: '/test/repo/.git/worktrees/feature/orca/issue-command-runner.sh',
|
||||
envVars: expect.objectContaining({
|
||||
ORCA_ROOT_PATH: '/test/repo',
|
||||
ORCA_WORKTREE_PATH: '/test/repo-feature'
|
||||
})
|
||||
Object.defineProperty(process, 'platform', {
|
||||
configurable: true,
|
||||
value: 'linux'
|
||||
})
|
||||
expect(vi.mocked(fs.writeFileSync)).toHaveBeenCalledWith(
|
||||
'/test/repo/.git/worktrees/feature/orca/issue-command-runner.sh',
|
||||
'#!/usr/bin/env bash\nset -e\ncodex exec "long command"\nclaude -p "review it"\n',
|
||||
'utf-8'
|
||||
)
|
||||
expect(vi.mocked(fs.chmodSync)).toHaveBeenCalledWith(
|
||||
'/test/repo/.git/worktrees/feature/orca/issue-command-runner.sh',
|
||||
0o755
|
||||
)
|
||||
|
||||
try {
|
||||
const { createIssueCommandRunnerScript } = await import('./hooks')
|
||||
const result = createIssueCommandRunnerScript(
|
||||
makeRepo(),
|
||||
'/test/repo-feature',
|
||||
'codex exec "long command"\nclaude -p "review it"'
|
||||
)
|
||||
|
||||
expect(result).toEqual({
|
||||
runnerScriptPath: '/test/repo/.git/worktrees/feature/orca/issue-command-runner.sh',
|
||||
envVars: expect.objectContaining({
|
||||
ORCA_ROOT_PATH: '/test/repo',
|
||||
ORCA_WORKTREE_PATH: '/test/repo-feature'
|
||||
})
|
||||
})
|
||||
expect(vi.mocked(fs.writeFileSync)).toHaveBeenCalledWith(
|
||||
'/test/repo/.git/worktrees/feature/orca/issue-command-runner.sh',
|
||||
'#!/usr/bin/env bash\nset -e\ncodex exec "long command"\nclaude -p "review it"\n',
|
||||
'utf-8'
|
||||
)
|
||||
expect(vi.mocked(fs.chmodSync)).toHaveBeenCalledWith(
|
||||
'/test/repo/.git/worktrees/feature/orca/issue-command-runner.sh',
|
||||
0o755
|
||||
)
|
||||
} finally {
|
||||
Object.defineProperty(process, 'platform', {
|
||||
configurable: true,
|
||||
value: originalPlatform
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user