Documentation
¶
Index ¶
- func CurrentShell(onlyName bool) (path string)
- func ExecCmd(binName string, args []string, workDir ...string) (string, error)
- func HasShellEnv(shell string) bool
- func IsConsole(out io.Writer) bool
- func IsLinux() bool
- func IsMSys() bool
- func IsMac() bool
- func IsWin() bool
- func IsWindows() bool
- func Kill(pid int, signal syscall.Signal) error
- func ProcessExists(pid int) bool
- func QuickExec(cmdLine string, workDir ...string) (string, error)
- func ShellExec(cmdStr string, shells ...string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentShell ¶ added in v0.1.4
CurrentShell get current used shell env file. eg "/bin/zsh" "/bin/bash"
func ExecCmd ¶ added in v0.1.4
ExecCmd an command and return output. Usage:
ExecCmd("ls", []string{"-al"})
func HasShellEnv ¶ added in v0.1.4
HasShellEnv has shell env check. Usage:
HasShellEnv("sh")
HasShellEnv("bash")
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.