exec

package
v0.15.3-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: Apache-2.0 Imports: 13 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command added in v0.11.0

func Command(name string, args ...string) ([]byte, error)

Command executes the given command with it's arguments and returns the standard output.

func Exec

func Exec(name string, arg ...string)

Exec is wrapper over syscall.Exec, invokes the execve(2) system call. On windows it executes Run with the same arguments.

func IsWSL added in v0.14.0

func IsWSL() bool

IsWSL returns true if Windows Subsystem for Linux is detected.

"Official" way of detecting WSL https://github.com/Microsoft/WSL/issues/423#issuecomment-221627364

func LookPath added in v0.14.0

func LookPath(file string) (string, error)

LookPath is an alias for exec.LookPath. It searches for an executable named file in the directories named by the PATH environment variable. If file contains a slash, it is tried directly and the PATH is not consulted. The result may be an absolute path or a path relative to the current directory.

func OpenInBrowser

func OpenInBrowser(url string) error

OpenInBrowser opens the given url on a web browser

func Run

func Run(name string, arg ...string)

Run is a wrapper over os/exec Cmd.Run that configures Stderr/Stdin/Stdout to the current ones and wait until the process finishes, exiting with the same code. Run will also forward all the signals sent to step to the command.

func RunWithPid

func RunWithPid(pidFile, name string, arg ...string)

RunWithPid calls Run and writes the process ID in pidFile.

func Step added in v0.9.0

func Step(args ...string) ([]byte, error)

Step executes step with the given commands and returns the standard output.

Types

This section is empty.

Jump to

Keyboard shortcuts

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