MCPcopy Create free account
hub / github.com/anomalyco/opencode / useDirectory

Function useDirectory

packages/tui/src/context/directory.ts:7–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5import { useTuiPaths } from "./runtime"
6
7export function useDirectory() {
8 const project = useProject()
9 const sync = useSync()
10 const paths = useTuiPaths()
11 return createMemo(() => {
12 const directory = project.instance.path().directory || paths.cwd
13 const result = abbreviateHome(directory, paths.home)
14 if (sync.data.vcs?.branch) return result + ":" + sync.data.vcs.branch
15 return result
16 })
17}

Callers 1

FooterFunction · 0.90

Calls 4

useSyncFunction · 0.90
useTuiPathsFunction · 0.90
abbreviateHomeFunction · 0.90
pathMethod · 0.80

Tested by

no test coverage detected