From 530c868949ac8bdc23d70fb1be443345a9aae12d Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Sat, 22 Jan 2022 20:39:34 -0700 Subject: [PATCH] expose Dir from pmuxprox.Config --- pmuxproc/pmuxproc.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pmuxproc/pmuxproc.go b/pmuxproc/pmuxproc.go index ce1d23a..a9469d1 100644 --- a/pmuxproc/pmuxproc.go +++ b/pmuxproc/pmuxproc.go @@ -25,6 +25,10 @@ type Config struct { // Env describes the environment variables to set on the process. Env map[string]string `yaml:"env"` + // Dir is the directory the process will be run in. If not set then the + // process is run in the same directory as this parent process. + Dir string + // MinWait and MaxWait are the minimum and maximum amount of time between // restarts that RunProcess will wait. // @@ -92,6 +96,7 @@ func RunProcessOnce(ctx context.Context, logger Logger, cfg Config) error { } cmd := exec.Command(cfg.Cmd, cfg.Args...) + cmd.Dir = cfg.Dir cmd.Env = make([]string, 0, len(cfg.Env)) for k, v := range cfg.Env {