Documentation
¶
Index ¶
- Constants
- func BuildEnv(base []string, projectEnv map[string]string, runInfo *run.Info) []string
- func ExecHandoff(path string, argv []string, env []string) error
- func GetEnv(env []string, key string) (string, bool)
- func MergeArgs(defaults, passArgs []string, aliases map[string]string, valueOptions []string, ...) []string
- func ResolvePath(path string) string
- func RunNoSyncWithStderr(root string, name string, enabled EnabledSelector, launch LaunchFunc, ...) error
- func RunWithStderr(ctx context.Context, root string, name string, enabled EnabledSelector, ...) error
- func SamePath(a, b string) bool
- func SetEnv(env []string, key string, value string) []string
- func UnsetEnv(env []string, key string) []string
- type EnabledSelector
- type LaunchFunc
Constants ¶
const (
// EnvDispatchActive blocks nested Agent Dispatch calls inside dispatched children.
EnvDispatchActive = "AL_DISPATCH_ACTIVE"
)
Variables ¶
This section is empty.
Functions ¶
func BuildEnv ¶
BuildEnv merges base env with project env and run metadata. A non-empty base value wins; a non-empty project value fills a key that is missing or empty in base, matching config.PlaceholderEnv. It strips AL_SHIM_ACTIVE because child processes are new execution contexts that should be free to dispatch independently; the dispatch guard is only meaningful for the exec replacement chain. It also strips AL_DISPATCH_ACTIVE so a leaked marker from the parent shell does not poison normal (non-dispatch) launches; the dispatch flow re-sets the marker explicitly on the dispatched child.
func ExecHandoff ¶ added in v0.12.0
ExecHandoff replaces the current al process with the target binary. On success it never returns. argv[0] must be the program name.
func MergeArgs ¶ added in v0.23.1
func MergeArgs(defaults, passArgs []string, aliases map[string]string, valueOptions []string, additive ...string) []string
MergeArgs removes generated options explicitly supplied by the caller before appending passArgs unchanged. defaults must contain only options, with values either joined by '=' or following options named in valueOptions. aliases maps native alternative spellings to the generated spelling; an empty mapping marks a valueless short option that can precede a value option in a cluster. additive explicitly names native repeatable value options: retain their generated entries unless the caller supplies the same value. Repeated caller options remain unchanged. This is not a full native argument parser: flag-shaped separate caller values may still be mistaken for options. Use --option=value for such literal values.
func ResolvePath ¶ added in v0.8.5
ResolvePath returns the absolute, symlink-resolved form of a path. If resolution fails at any step, it returns the best result available.
func RunNoSyncWithStderr ¶ added in v0.8.1
func RunNoSyncWithStderr(root string, name string, enabled EnabledSelector, launch LaunchFunc, quiet bool, args []string, stderr io.Writer) error
RunNoSyncWithStderr loads config and launches a client without syncing. Warnings are printed to the supplied stderr writer.
func RunWithStderr ¶
func RunWithStderr(ctx context.Context, root string, name string, enabled EnabledSelector, launch LaunchFunc, quiet bool, args []string, currentVersion string, stderr io.Writer) error
RunWithStderr loads config, syncs, creates a run directory, and launches a client. Warnings from sync are printed to the supplied stderr writer before launching.
func SamePath ¶ added in v0.8.5
SamePath returns true if two paths resolve to the same filesystem location, accounting for symlinks and relative paths.
Types ¶
type EnabledSelector ¶
EnabledSelector returns the enabled flag for a client.
type LaunchFunc ¶
type LaunchFunc func(project *config.ProjectConfig, runInfo *run.Info, env []string, args []string) error
LaunchFunc launches a client after sync and run setup.