command

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCommandVersion

func GetCommandVersion(binary string) (string, error)

GetCommandVersion returns the version of an executable

func GetFreePort

func GetFreePort() (int, error)

GetFreePort asks the kernel for a free open port that is ready to use.

func GetPlatformSpecificCommand

func GetPlatformSpecificCommand(platform string, file string, args string, workDir string) (*exec.Cmd, error)

GetPlatformSpecificCommand returns a platform-specific exec.Cmd

func IsFreePort

func IsFreePort(port int) bool

IsFreePort asks the kernel if the requested port is available or not

func RunAPICommand

func RunAPICommand(command string, env map[string]string, projectDir string, workDir string, capture bool, ports []int) (stdout string, stderr string, err error)

RunAPICommand gets called from actions or the api to execute commands

func RunCommand

func RunCommand(command string, env map[string]string, workDir string)

RunCommand runs a required command and forwards all output to console, but will panic/exit if the command fails

func RunCommandAndGetOutput

func RunCommandAndGetOutput(command string, env map[string]string, workDir string) (string, error)

RunCommandAndGetOutput runs a command and returns the full response / command output

func RunOptionalCommand

func RunOptionalCommand(command string, env map[string]string, workDir string) error

RunOptionalCommand runs a command and forwards all output to console

func RunSystemCommandPassThru

func RunSystemCommandPassThru(file string, args string, env map[string]string, workDir string, stdout io.Writer, stderr io.Writer) error

RunSystemCommandPassThru runs a command and forwards all output to current console session

Types

This section is empty.

Jump to

Keyboard shortcuts

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