Documentation ¶
Index ¶
- Constants
- func AppendEnv(env []string, addEnv []string) []string
- func ExecName(name string) string
- func FilepathClean(s string) string
- func FilepathHasDirPrefix(s, prefix string) bool
- func FilepathSplitAt(s string, n int) string
- func FsCaseFilename(filename string) (string, error)
- func GetEnv(env []string, key string) string
- func GetFreeTcpPort() (int, error)
- func HomeEnvVar() string
- func KillExecCmd(cmd *exec.Cmd) error
- func OpenBrowser(url string) error
- func OpenExternal(name string) error
- func OpenFilemanager(filename string) error
- func OpenTerminal(filename string) error
- func RandomPort(simpleSeed, min, max int) int
- func RunCmd(ctx context.Context, dir string, args ...string) ([]byte, error)
- func RunCmdI(ci CmdI) error
- func RunCmdICombineStderrErr(c CmdI) ([]byte, error)
- func RunCmdICombineStdoutStderr(c CmdI) ([]byte, error)
- func RunCmdIOutputs(c CmdI) (sout []byte, serr []byte, _ error)
- func RunCmdStdin(ctx context.Context, dir string, rd io.Reader, args ...string) ([]byte, error)
- func SetEnv(env []string, key, value string) []string
- func SetupExecCmdSysProcAttr(cmd *exec.Cmd)
- func ShellCmdArgs(args ...string) []string
- func ShellScriptArgs(args ...string) []string
- func UnquoteEnvValues(env []string) []string
- type BasicCmd
- type CmdI
- type CtxCmd
- type NoHangPipeCmd
- type PausedWritersCmd
- type ShellCmd
- type TmpFiles
- func (tf *TmpFiles) MkdirInTmp(path string) (string, error)
- func (tf *TmpFiles) MkdirInTmpOrPanic(path string) string
- func (tf *TmpFiles) RemoveAll() error
- func (tf *TmpFiles) WriteFileInTmp(path string, src []byte) (string, error)
- func (tf *TmpFiles) WriteFileInTmp2OrPanic(path string, src string) string
- func (tf *TmpFiles) WriteFileInTmpOrPanic(path string, src []byte) string
Constants ¶
View Source
const EscapeRune = '\\'
Variables ¶
This section is empty.
Functions ¶
func FilepathClean ¶ added in v1.1.0
func FilepathHasDirPrefix ¶
func FilepathSplitAt ¶
Result does not start with separator.
func FsCaseFilename ¶ added in v1.3.3
func GetFreeTcpPort ¶ added in v1.1.0
func HomeEnvVar ¶
func HomeEnvVar() string
func KillExecCmd ¶
func OpenBrowser ¶ added in v1.1.0
doesn't wait for the cmd to end
func OpenExternal ¶ added in v1.3.7
doesn't wait for the cmd to end
func OpenFilemanager ¶ added in v1.1.0
doesn't wait for the cmd to end
func OpenTerminal ¶ added in v1.3.1
doesn't wait for the cmd to end
func RandomPort ¶ added in v1.1.0
func RunCmdICombineStderrErr ¶ added in v1.3.7
func RunCmdICombineStdoutStderr ¶ added in v1.3.7
func RunCmdIOutputs ¶ added in v1.3.7
func RunCmdStdin ¶ added in v1.3.7
func SetupExecCmdSysProcAttr ¶
func ShellCmdArgs ¶ added in v1.3.9
deals correctly with args that contain spaces scripting possible with args[0] set to "<script>; true"
func ShellScriptArgs ¶ added in v1.3.9
allows scripting, but can have issues on args with spaces: ex: "echo a > b.txt" ex: "VAR_1=2 prog arg1 arg2"
func UnquoteEnvValues ¶ added in v1.3.1
Types ¶
type BasicCmd ¶ added in v1.3.3
type BasicCmd struct {
// contains filtered or unexported fields
}
func NewBasicCmd ¶ added in v1.3.3
type NoHangPipeCmd ¶ added in v1.3.7
type NoHangPipeCmd struct { CmdI // contains filtered or unexported fields }
func NewNoHangPipeCmd ¶ added in v1.3.7
func NewNoHangPipeCmd(cmdi CmdI, doIn, doOut, doErr bool) *NoHangPipeCmd
func NewNoHangStdinCmd ¶ added in v1.3.9
func NewNoHangStdinCmd(cmdi CmdI) *NoHangPipeCmd
func (*NoHangPipeCmd) CloseStdin ¶ added in v1.3.7
func (c *NoHangPipeCmd) CloseStdin() error
some commands will not exit unless the stdin is closed, allow access
func (*NoHangPipeCmd) Start ¶ added in v1.3.7
func (c *NoHangPipeCmd) Start() error
type PausedWritersCmd ¶ added in v1.3.7
type PausedWritersCmd struct { CmdI // contains filtered or unexported fields }
ex: usefull to print something before any cmd output is printed
func NewPausedWritersCmd ¶ added in v1.3.7
func NewPausedWritersCmd(cmdi CmdI, cb func(CmdI)) *PausedWritersCmd
func (*PausedWritersCmd) Start ¶ added in v1.3.7
func (c *PausedWritersCmd) Start() error
func (*PausedWritersCmd) Wait ¶ added in v1.3.7
func (c *PausedWritersCmd) Wait() error
type TmpFiles ¶
type TmpFiles struct {
Dir string
}
func NewTmpFiles ¶
func (*TmpFiles) MkdirInTmpOrPanic ¶
Returns the filename
func (*TmpFiles) WriteFileInTmp ¶
func (*TmpFiles) WriteFileInTmp2OrPanic ¶
Returns the filename
Click to show internal directories.
Click to hide internal directories.