execx

package
v0.0.0-...-dae269f Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package execx provides thin wrappers around the os.Exec package.

Index

Constants

View Source
const CommandError = 127

CommandError is returned by Exec when a command could not be executed. This typically hints that the executable cannot be found, but may have other causes.

Variables

This section is empty.

Functions

func CommandErrorFunc

func CommandErrorFunc() int

CommandErrorFunc always returns CommandError.

func Exec

func Exec(ctx context.Context, io stream.IOStream, workdir string, exe string, argv ...string) func() int

Exec executes a system command with the specified input/output streams, working directory, and arguments.

The command is started immediatly. The returned function is guaranteed to be non-nil and returns an exit code.

If the command executes, the returns the exit code as soon as the process executes. If the command can not be executed, the returned function is [ExecCommandErrorFunc] and returns [ExecCommandError].

func LookPathAbs

func LookPathAbs(file string) (string, error)

LookPathAbs looks for the path named "file" and then resolves this path absolutely.

func MustExec

func MustExec(ctx context.Context, io stream.IOStream, workdir string, exe string, argv ...string) bool

MustExec is like Exec, except that it returns true if the command exited successfully, and else false.

Types

This section is empty.

Jump to

Keyboard shortcuts

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