Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureWorktreeDeps ¶
EnsureWorktreeDeps sets up a worktree checkout with the dependencies it needs:
- vendor/ and node_modules/ are symlinked from the main repo
- .env is copied from the main repo with APP_URL rewritten to http(s)://<worktreeDomain>
func IsMainRepo ¶
IsMainRepo returns true if sitePath/.git is a directory (not a file). A file means the repo itself is a worktree, not the main checkout.
func MainBranch ¶
MainBranch returns the current branch of the main repo checkout at sitePath, or an empty string if it cannot be determined.
func SanitizeBranch ¶
SanitizeBranch converts a branch name to a subdomain-safe slug.
Types ¶
type Worktree ¶
type Worktree struct {
Name string // subdirectory name under .git/worktrees/
Branch string // sanitized branch (subdomain-safe)
Path string // absolute path to checkout dir
Domain string // "<sanitized-branch>.<siteDomain>"
}
Worktree represents a git worktree checkout for a registered site.
func DetectWorktrees ¶
DetectWorktrees returns the list of active worktrees for the given site.
Click to show internal directories.
Click to hide internal directories.