detectDevCommand
detectDevCommand(
worktreePath,fs?):Promise<string|null>
Defined in: src/preview.ts:104
Resolve the dev-server command for a worktree, using injectable fs accessors.
Resolution order:
- Root package.json with scripts.dev →
<pm> run dev - Exactly one curated/workspace subdir with scripts.dev →
cd <dir> && <pm> run dev - Zero or multiple subdirs → null
NEVER uses sync fs operations (hard rule for Shepherd’s single Bun event loop).
Parameters
Section titled “Parameters”worktreePath
Section titled “worktreePath”string
FsAccessors = realFs
Returns
Section titled “Returns”Promise<string | null>