command

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package command is scriptling.provision.command: run commands while provisioning a machine, as the script's user or as root.

Index

Constants

View Source
const (
	LibraryName = "scriptling.provision.command"
	LibraryDesc = "Run commands while provisioning a machine, as the script's user or as root"
)

Variables

This section is empty.

Functions

func Failure

func Failure(cmd []string, res become.RunResult) string

Failure describes a command that exited with a non-zero status, with the end of what it said.

func PermissionError

func PermissionError(name string, err error) object.Object

PermissionError reports err as the uncatchable PermissionError when it is running as root where that is not allowed.

func Quote

func Quote(cmd []string) string

Quote shows a command as a shell would take it.

func Register

func Register(registrar interface{ RegisterLibrary(*object.Library) })

Register registers the library with running as root off.

func RegisterConfigured

func RegisterConfigured(registrar interface{ RegisterLibrary(*object.Library) }, opts ...Option)

RegisterConfigured registers the library with its options.

Types

type Option

type Option func(*libraryInstance)

Option configures the library.

func WithBecome

func WithBecome(b *become.Become) Option

WithBecome lets scripts run commands as root with become=True, through b. Without it, become=True fails unless the process is already root.

Jump to

Keyboard shortcuts

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