diff --git a/linux/interface.go b/linux/interface.go index 384ef94..ed25b04 100644 --- a/linux/interface.go +++ b/linux/interface.go @@ -10,7 +10,7 @@ type LinuxCommand struct { type CommandOptions struct { Env map[string]string - Sources map[string]string + Sources []string Command string Args []string Cwd string diff --git a/linux/run.go b/linux/run.go index e2bb35d..7c612d7 100644 --- a/linux/run.go +++ b/linux/run.go @@ -29,7 +29,12 @@ func NewCommand(options CommandOptions) (*LinuxCommand, error) { func (cmd *LinuxCommand) Run() error { - command := exec.Command(cmd.Options.Shell, "--rcfile", "testrc", "-c", cmd.Options.Command) + var sourceCommand string + for _, value := range cmd.Options.Sources { + sourceCommand += fmt.Sprintf("source %s && ", value) + } + + command := exec.Command(cmd.Options.Shell, "-c", sourceCommand+cmd.Options.Command) command.Dir = cmd.Options.Cwd command.Args = append(command.Args, cmd.Options.Args...)