Documentation ¶
Index ¶
- func CompareOsEnv(key, comparedEnv string) bool
- func ExecCommand(command string, opts ...Option) (stdout, stderr string, err error)
- func GetOsBits() int
- func GetOsEnv(key string) string
- func IsLinux() bool
- func IsMac() bool
- func IsWindows() bool
- func RemoveOsEnv(key string) error
- func SetOsEnv(key, value string) error
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareOsEnv ¶
CompareOsEnv gets env named by the key and compare it with comparedEnv.
func ExecCommand ¶
ExecCommand execute command, return the stdout and stderr string of command, and error if error occur param `command` is a complete command string, like, ls -a (linux), dir(windows), ping 127.0.0.1 in linux, use /bin/bash -c to execute command in windows, use powershell.exe to execute command
func RemoveOsEnv ¶
RemoveOsEnv remove a single environment variable.
Types ¶
type Option ¶
func WithForeground ¶
func WithForeground() Option
func WithWinHide ¶
func WithWinHide() Option
Click to show internal directories.
Click to hide internal directories.