Documentation
¶
Index ¶
- func AskForSudo() error
- func Exec(currentWorkingDir string, cmdFmtStr string, args ...interface{}) (stdout string, stderr string, exitCode int, err error)
- func ExpandPath(path string) string
- func GetProjectBranch(gitDirectory string) (string, error)
- func GetProjectShortHash(gitDirectory string) (string, error)
- func IsDirectory(path string) bool
- func IsFile(path string) bool
- func SafeDelete(parentPath, targetPath string) error
- func ShallowCloneRepo(projectPath, gitUrl, gitBranch string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AskForSudo ¶
func AskForSudo() error
func Exec ¶
func Exec(currentWorkingDir string, cmdFmtStr string, args ...interface{}) (stdout string, stderr string, exitCode int, err error)
Exec runs a command "sprintf(cmdFmtStr, args)" and return stdout, stderr and exitcode of the command. If exitCode != 0, err will return with a nicely-formatted map of the command's outputs
XXX This command is a simple wrapper around exec.Command(). The following are cases this command does **NOT** accommodate:
- Using environments in a command
- Having a field in the command that includes a space as part of the parameter i.e., ./bin -param iPhone 12 # where the input of -param is "iPhone 12", not just "iPhone"
func ExpandPath ¶
Expand expands the path to include the home directory if the path is prefixed with `~`. If it isn't prefixed with `~`, the path is returned as-is.
func GetProjectBranch ¶
func GetProjectShortHash ¶
func IsDirectory ¶
func SafeDelete ¶ added in v1.0.3
func ShallowCloneRepo ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.