run

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2025 License: GPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean added in v0.1.0

func Clean(cfg *config.DuckConf, targetName string) error

Clean removes cached objects and per-target working dirs. If targetName is empty, purge everything. Otherwise, clean only that target’s cache and its currently referenced object.

func Exec

func Exec(cfg *config.DuckConf, targetName string, passthrough []string, securityCfg *config.SecurityConfig, trackCommitHashFlag *bool, autoUpdateOnChangeFlag *bool) error

Exec renders and executes one target.

This function uses the shared prepareAndRenderTemplate function for template processing (variable resolution, caching, checksum validation, etc.) and then executes the target's binary with the rendered template.

func Sync added in v0.1.0

func Sync(cfg *config.DuckConf, targetName string, force bool, securityCfg *config.SecurityConfig, trackCommitHashFlag *bool, autoUpdateOnChangeFlag *bool) error

Sync renders templates into the cache without executing the target. If targetName is empty, all targets (default + named) are synced. If force is true, re-render regardless of existing cache.

This function now shares the same template preparation logic as Exec, including checksum validation, through the prepareAndRenderTemplate function.

func TestGetCloneFunc added in v0.1.0

func TestGetCloneFunc() func(string, string, string, bool) (string, error)

TestGetCloneFunc returns the current cloneFunc seam.

func TestGetExecCommand added in v0.1.0

func TestGetExecCommand() func(string, ...string) *exec.Cmd

TestGetExecCommand exposes current execCommand seam.

func TestSetCloneFunc added in v0.1.0

func TestSetCloneFunc(f func(string, string, string, bool) (string, error))

TestSetCloneFunc overrides the internal cloneFunc seam for external (cmd package) tests.

func TestSetExecCommand added in v0.1.0

func TestSetExecCommand(f func(string, ...string) *exec.Cmd)

TestSetExecCommand overrides the execCommand seam.

Types

type PrepareTemplateResult added in v0.6.1

type PrepareTemplateResult struct {
	ObjFile        string // Path to rendered object file
	LinkPath       string // Path where symlink should point
	OldRenderedKey string // Previous rendered cache key (for cleanup)
	RenderedKey    string // Current rendered cache key
	RemoteKey      string // Remote cache key (stable for repo/ref/path)

	// New fields for environment variables
	RepoPath     string // Path to cloned repository
	RepoURL      string // Repository URL
	RepoRef      string // Git reference used
	TemplatePath string // Source template file path
	TargetName   string // Target name being executed
	CacheDir     string // Per-target cache directory
}

PrepareTemplateResult holds the results of template preparation shared between Exec and Sync operations

Jump to

Keyboard shortcuts

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