mg

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const CacheEnv = "MAGEFILE_CACHE"

CacheEnv is the environment variable that users may set to change the location where mage stores its compiled binaries.

Variables

This section is empty.

Functions

func CacheDir

func CacheDir() string

CacheDir returns the directory where mage caches compiled binaries. It defaults to $HOME/.magefile, but may be overridden by the MAGEFILE_CACHE environment variable.

func Deps

func Deps(fns ...interface{})

Deps runs the given functions as dependencies of the calling function. Dependencies must only be func() or func() error. The function calling Deps is guaranteed that all dependent functions will be run exactly once when Deps returns. Dependent functions may in turn declare their own dependencies using Deps. Each dependency is run in their own goroutines.

func ExitStatus

func ExitStatus(err error) int

ExitStatus queries the error for an exit status. If the error is nil, it returns 0. If the error does not implement ExitStatus() int, it returns 1. Otherwise it retiurns the value from ExitStatus().

func Fatal

func Fatal(code int, args ...interface{}) error

Fatal returns an error that will cause mage to print out the given args and exit with the given exit code.

func Fatalf

func Fatalf(code int, format string, args ...interface{}) error

Fatalf returns an error that will cause mage to print out the given message and exit with an exit code of 1.

func Verbose

func Verbose() bool

Verbose reports whether a magefile was run with the verbose flag.

Types

This section is empty.

Jump to

Keyboard shortcuts

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