projectdir

package
v0.95.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package projectdir resolves project-specific state directories under $XDG_STATE_HOME/sidecar/projects/<slug>/ (defaults to ~/.local/state/sidecar/projects/<slug>/). Each project root gets a unique slug-named directory containing a meta.json that maps back to the original project path.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lookup added in v0.93.0

func Lookup(projectRoot string) (string, bool)

Lookup returns the already-registered data directory for a project root without creating anything. Diagnostics use it: a function whose job is to report what this process will write to must not itself write.

func LookupWorktree added in v0.94.0

func LookupWorktree(projectRoot, worktreePath string) (string, bool)

LookupWorktree returns the already-registered data directory for worktreePath without creating or migrating state. It is intended for read-only inventory consumers such as diagnostics and the cross-project overview.

func Resolve

func Resolve(projectRoot string) (string, error)

Resolve returns the data directory for the given project root path. It creates the directory (with meta.json) if it does not already exist. On subsequent calls with the same projectRoot, the existing directory is returned.

func ResolveWithBase

func ResolveWithBase(base, projectRoot string) (string, error)

ResolveWithBase is the exported, testable form of Resolve. base overrides the state directory (e.g. a temp dir in tests).

func WorktreeDir

func WorktreeDir(projectRoot, worktreePath string) (string, error)

WorktreeDir returns the worktree-specific data directory for a project. The directory is created if it does not exist.

func WorktreeDirContext added in v0.94.0

func WorktreeDirContext(ctx context.Context, projectRoot, worktreePath string) (string, error)

WorktreeDirContext resolves worktree state while allowing legacy Git inventory to be cancelled with its owning lifecycle operation.

func WorktreeDirWithBase

func WorktreeDirWithBase(base, projectRoot, worktreePath string) (string, error)

WorktreeDirWithBase is the exported, testable form of WorktreeDir. base overrides the state directory (e.g. a temp dir in tests).

func WorktreeKey added in v0.94.0

func WorktreeKey(worktreePath string) (string, error)

WorktreeKey is stable across restarts and independent of presentation names.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL