Clean up code and update docs
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user