Files
opencode-manager/backend/test/helpers/repo-root.ts
Chris Scott 6c635397ba feat(docker): run container as host user with bind-mounted workspace (#328)
* feat(docker): run container as host user with bind-mounted workspace


* fix(docker): warn on workspace gid mismatch as well as uid

* fix(docker): eval snippet passed as positional arg in container-user tests

* docs(installation): drop stale host repository access reference
2026-07-28 11:30:50 -04:00

15 lines
402 B
TypeScript

import { existsSync } from 'fs'
import { dirname, join, resolve } from 'path'
export function findRepoRoot(start: string): string {
let dir = start
while (!existsSync(join(dir, 'pnpm-workspace.yaml'))) {
const parent = dirname(dir)
if (parent === dir) throw new Error('repo root not found')
dir = parent
}
return dir
}
export const repoRoot = findRepoRoot(resolve(process.cwd()))