utils

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAbort          = errors.New("user said no")
	ErrNotInteractive = errors.New("not an interactive terminal: cannot ask user confirmation")
)

Functions

func FileExists

func FileExists(filename string) bool

FileExists checks if a file exists and is not a directory

func FolderExists

func FolderExists(filename string) bool

FolderExists checks if a folder exists and is indeed a folder.

func FolderIsEmpty

func FolderIsEmpty(filename string) (bool, error)

FolderIsEmpty checks if a folder is empty

func HomeDir

func HomeDir() string

Returns the user's home directory. On Linux and MacOS, this is equivalent to resolving `~` On Windows, this is equivalent to %USERPROFILE%

func IsInteractive

func IsInteractive() bool

IsInteractive returns true if `deb` is currently being executed in a terminal, thus probably with a human interacting with it.

func PromptConfirm

func PromptConfirm(format string, args ...interface{}) error

PromptConfirm will ask the user for confirmation

Types

This section is empty.

Jump to

Keyboard shortcuts

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