cast

package
v0.16.3 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package cast provides utility funcs for magefiles.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirPrepSh

func DirPrepSh(prefix string) func(dir, suffix string, a ...interface{}) error

DirPrepSh prepares an Sh invocation with the provided prefix. when the returned func is executed, prefix and suffix are joined with a space, then passed in to Sh along with any values for a.

This version allows giving a directory to execute in. If you only wish to pass values for a, use "" for suffix.

func DirSh

func DirSh(dir, format string, a ...interface{}) error

DirSh formats the provided string and arguments, tokenizes the result using shell style rules, and then executes the result in a way similar to mage's sh.RunWith under the provided working directory.

func PrepShOutput

func PrepShOutput(prefix string) func(suffix string, a ...interface{}) (string, error)

PrepShOutput prepares an ShOut invocation with the provided prefix. when the returned func is executed, prefix and suffix are joined with a space, then passed in to Sh along with any values for a.

If you only wish to pass values for a, use "" for suffix.

func Sh

func Sh(format string, a ...interface{}) error

Sh formats the provided string and arguments, tokenizes the result using shell style rules, and then executes the result with mage's sh.RunWith.

func ShOutput

func ShOutput(format string, a ...interface{}) (string, error)

ShOutput formats the provided string and arguments, tokenizes the result using shell style rules, and then executes the result with mage's sh.OutputWith

Types

This section is empty.

Jump to

Keyboard shortcuts

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