ea6d610dee
This patch fixes the quoting for executing scripts on windows and splits the platform dependent code. Fixes #1875
19 lines
304 B
Go
19 lines
304 B
Go
// +build !windows
|
|
|
|
package agent
|
|
|
|
import (
|
|
"os"
|
|
"os/exec"
|
|
)
|
|
|
|
|
|
// ExecScript returns a command to execute a script
|
|
func ExecScript(script string) (*exec.Cmd, error) {
|
|
shell := "/bin/sh"
|
|
if other := os.Getenv("SHELL"); other != "" {
|
|
shell = other
|
|
}
|
|
return exec.Command(shell, "-c", script), nil
|
|
}
|