add env options

This commit is contained in:
Shane C 2024-07-09 17:45:33 -04:00
parent bde6ae681e
commit 992dd14272
Signed by: shane
GPG key ID: E46B5FEA35B22FF9

View file

@ -69,6 +69,10 @@ func (cmd *LinuxCommand) Run() error {
command := exec.Command(cmd.Options.Shell, "-c", sourceCommand.String()+cmd.Options.Command+commandOptions.String()) command := exec.Command(cmd.Options.Shell, "-c", sourceCommand.String()+cmd.Options.Command+commandOptions.String())
command.Dir = cmd.Options.Cwd command.Dir = cmd.Options.Cwd
for key, value := range cmd.Options.Env {
command.Env = append(command.Env, fmt.Sprintf("%s=%s", key, value))
}
var signalChannel chan os.Signal var signalChannel chan os.Signal
if len(cmd.handlers) != 0 { if len(cmd.handlers) != 0 {