helpers

package
v0.0.0-...-605e3c9 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Capture

func Capture(env Vars, name string, args ...string) (_ string, exitErr error)

Capture command stdout and return it as a string.

func Cd

func Cd(dir string, f func())

Cd into the given directory and execute f(). Restores the original working directory upon return.

func Exec

func Exec(env Vars, name string, args ...string) (exitErr error)

Exec a command with the given args as a subprocess, redirecting all output to the stdout/stderr. Blocks until execution is completed.

func FileSize

func FileSize(f string) int64

FileSize returns size of the given file.

func Group

func Group(name string, f func())

Group wraps output of f() into a collapsible block in action execution log.

func Must

func Must(predicate interface{}, msg string, args ...interface{})

Must panics is the error is not nil.

func TempDir

func TempDir() string

TempDir create and return a temporary directory. Panics if fails.

Types

type Vars

type Vars map[string]string

Vars is a helper type to work with environment variables.

Jump to

Keyboard shortcuts

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