exec

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: MIT Imports: 12 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureDir

func EnsureDir(dir string) (err error)

EnsureDir checks and creates the directory.

func EnsureDirEnh

func EnsureDirEnh(dir string) (err error)

EnsureDirEnh checks and creates the directory, via sudo if necessary.

func FileExists

func FileExists(name string) bool

FileExists returns the existence of an directory or file

func GetCurrentDir

func GetCurrentDir() string

GetCurrentDir returns the current workingFlag directory it should be equal with os.Getenv("PWD")

func GetExcutablePath

func GetExcutablePath() string

GetExcutablePath returns the executable file path

func GetExecutableDir

func GetExecutableDir() string

GetExecutableDir returns the executable file directory

func IsDirectory

func IsDirectory(path string) (bool, error)

IsDirectory tests whether `path` is a directory or not

func IsEAccess

func IsEAccess(err error) bool

IsEAccess detects whether err is a EACCESS errno or not

func IsExitError

func IsExitError(err error) (int, bool)

IsExitError checks the error object

func IsRegularFile

func IsRegularFile(path string) (bool, error)

IsRegularFile tests whether `path` is a normal regular file or not

func NormalizeDir

func NormalizeDir(s string) string

NormalizeDir make dir name normalized

func RemoveDirRecursive

func RemoveDirRecursive(dir string) (err error)

RemoveDirRecursive removes a directory and any children it contains.

func Run

func Run(command string, arguments ...string) error

Run runs an OS command

func RunCommand

func RunCommand(command string, readStdout bool, arguments ...string) (int, string, error)

RunCommand runs an OS command

func RunWithOutput

func RunWithOutput(command string, arguments ...string) (int, string, error)

RunWithOutput runs an OS command and collect the result outputting

func Sudo

func Sudo(command string, arguments ...string) (int, string, error)

Sudo runs an OS command with sudo prefix

Types

This section is empty.

Jump to

Keyboard shortcuts

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