Clean up code and update docs

This commit is contained in:
Ian Fijolek
2019-10-02 16:09:11 -07:00
parent 7b746ed62a
commit ba33071070
5 changed files with 61 additions and 22 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ import (
"strings"
)
/// escapeCommandShell accepts a command to be executed by a shell and escapes it
// escapeCommandShell accepts a command to be executed by a shell and escapes it
func escapeCommandShell(command string) string {
// Remove extra spaces and newlines from ends
command = strings.TrimSpace(command)
@@ -15,7 +15,7 @@ func escapeCommandShell(command string) string {
return command
}
/// ShellCommand takes a string and executes it as a command using `sh`
// ShellCommand takes a string and executes it as a command using `sh`
func ShellCommand(command string) *exec.Cmd {
shellCommand := []string{"sh", "-c", escapeCommandShell(command)}
//log.Printf("Shell command: %v", shellCommand)