platform

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// InstallModeSymlink records a target installed as a symlink.
	InstallModeSymlink = "symlink"
	// InstallModeCopy records a target installed as a copied file or directory.
	InstallModeCopy = "copy"
)
View Source
const (
	// EnvHome is the environment variable used to override the ContextCart home.
	EnvHome = "CONTEXTCART_HOME"
)

Variables

This section is empty.

Functions

func CleanAbs

func CleanAbs(raw string) (string, error)

CleanAbs returns an absolute, cleaned path.

func InsideDir

func InsideDir(base, target string) (bool, error)

InsideDir reports whether target is base itself or contained inside base.

func LinkOrCopy

func LinkOrCopy(src, dst string, preferSymlink bool) (mode string, err error)

LinkOrCopy places src at dst by symlink when requested and possible, otherwise by copying. It never overwrites an existing target.

func RelForDisplay

func RelForDisplay(base, target string) string

RelForDisplay returns target relative to base when possible, using slash separators for stable CLI output.

func ResolveHome

func ResolveHome(override string) (string, error)

ResolveHome returns the ContextCart home directory.

Precedence is explicit override, CONTEXTCART_HOME, then the OS user home plus ".contextcart". The returned path is absolute and cleaned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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