Documentation
¶
Index ¶
- Constants
- Variables
- func BoolValue(b *bool) bool
- func Confirm(msg string) bool
- func DownloadUrl(url, dest string) error
- func ExpandTilde(paths []string) []string
- func ExtractArchiveBinary(src, dest, binary string) error
- func FindBinary(binaryNames map[string]string, destFolder string) (string, error)
- func FormatErrors(errs []error) string
- func GetFileExtensionFromURL(rawurl string) (string, error)
- func HandleError(err error, msg ...string)
- func NewSpinner(cfg yacspin.Config)
- func OpenURL(url string) error
- func SetSpinnerQuiet(quiet bool)
- func SpinnerConfig() yacspin.Config
Constants ¶
View Source
const ( RedColor = "\033[31m" YellowColor = "\033[33m" BlueColor = "\033[34m" ResetColor = "\033[0m" )
ANSI escape codes for color
Variables ¶
View Source
var (
Spinner *yacspin.Spinner
)
global spinner
Functions ¶
func BoolValue ¶ added in v0.2.2
boolValue safely dereferences a bool pointer, returning false if nil
func DownloadUrl ¶ added in v0.2.0
downloads a file from a url and places it in a specified destination
func ExpandTilde ¶ added in v0.2.1
Function to expand the tilde (~) to the full home directory path @Example ~/Pictures/flowers.png --> /home/username/Pictures/flowers.png
func ExtractArchiveBinary ¶ added in v0.2.2
func FindBinary ¶ added in v0.2.2
FindBinary checks that the binary exists in dest or $PATH, preferring $PATH. Checks that binary also has executable permissions.
func FormatErrors ¶ added in v0.1.6
Formats a slice of errors to a single error, each seperated by a new line
func GetFileExtensionFromURL ¶ added in v0.1.7
func HandleError ¶ added in v0.1.6
Prints the error in red and exits
func SetSpinnerQuiet ¶ added in v0.2.2
func SetSpinnerQuiet(quiet bool)
Sets the spinner to quiet mode by discarding all output to not interfere with Unix pipes or redirections
func SpinnerConfig ¶ added in v0.2.2
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.