Documentation
¶
Overview ¶
Package copyfiles copies gitignored local files (e.g. .env) from the main worktree into a linked worktree, since git worktrees do not include gitignored files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Sync ¶
Sync copies every file matching patterns from srcRoot into dstRoot, preserving each match's path relative to srcRoot, and returns the relative paths it copied. Patterns are globs relative to srcRoot (e.g. ".env", ".env.*", "config/local.yml"). It never overwrites a file that already exists in dstRoot, skips directories and matches that escape srcRoot, and is a no-op when srcRoot and dstRoot are the same directory (the main worktree).
func UpsertEnv ¶
UpsertEnv sets each key in vars to its value in the dotenv file at path, replacing an existing assignment (correcting a value copied from elsewhere) or appending the key if absent, while leaving every other line and comment untouched. isola uses it so a worktree's env file carries that worktree's resolved env (accessory URLs, etc.), for tools that read the file directly rather than the process environment. If the file does not exist: when create is true it is created (with the given vars), otherwise it is a no-op (returns no keys). Returns the keys changed.
Types ¶
This section is empty.