Documentation ¶
Index ¶
- func PipeCommands(commands ...*exec.Cmd) ([]byte, error)
- func SafeJoin(parent, subdir string) (string, error)
- func SaveFileonTempDir(filename string, data io.Reader) (string, error)
- func TellCommandNotToSpawnShell(_ *exec.Cmd)
- func UserPrompt(dialog string, buttons string, defaultButton string, toPress string, ...) bool
- func VerifyInput(input string, signature string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PipeCommands ¶
PipeCommands executes the commands received as input by feeding the output of one to the input of the other, exactly like Unix Pipe (|). Returns the output of the final command and the eventual error.
code inspired by https://gist.github.com/tyndyll/89fbb2c2273f83a074dc
func SafeJoin ¶
SafeJoin performs a filepath.Join of 'parent' and 'subdir' but returns an error if the resulting path points outside of 'parent'.
func SaveFileonTempDir ¶
SaveFileonTempDir creates a temp directory and saves the file data as the filename in that directory. Returns an error if the agent doesn't have permission to create the folder. Returns an error if the filename doesn't form a valid path.
Note that path could be defined and still there could be an error.
func TellCommandNotToSpawnShell ¶
TellCommandNotToSpawnShell will now spawn a shell
func UserPrompt ¶
func UserPrompt(dialog string, buttons string, defaultButton string, toPress string, title string) bool
UserPrompt executes an osascript and returns the pressed button
func VerifyInput ¶
VerifyInput will verify an input against a signature A valid signature is indicated by returning a nil error.
Types ¶
This section is empty.