copy

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package copy provides primitives for seeding an env file by copying it from another location. Paths may be absolute, `~`-prefixed, or relative to a configured base directory (typically the main worktree root).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func File

func File(src, dst string) error

File copies src to dst atomically (via temp-file-then-rename), preserving src's permissions. If dst already exists it is replaced. Callers are responsible for deciding whether overwriting is allowed and for backing up the previous file if needed.

func ResolveSource

func ResolveSource(source, baseDir, homeDir string) (string, error)

ResolveSource turns a user-provided source path into an absolute path. Absolute paths are returned as-is (after Clean), `~`-prefixed paths are expanded against homeDir, and everything else is resolved relative to baseDir (typically the main worktree root).

homeDir may be empty; if so, `~`-prefixed paths return an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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