diff options
Diffstat (limited to 'internal/command/option.go')
-rw-r--r-- | internal/command/option.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/command/option.go b/internal/command/option.go index d5ec59635..cca8e62f1 100644 --- a/internal/command/option.go +++ b/internal/command/option.go @@ -10,6 +10,7 @@ type config struct { stdin io.Reader stdout io.Writer stderr io.Writer + dir string environment []string finalizer func(*Command) @@ -56,6 +57,13 @@ func WithStderr(stderr io.Writer) Option { } } +// WithDir will set up the command to be ran in the specific directory. +func WithDir(dir string) Option { + return func(cfg *config) { + cfg.dir = dir + } +} + // WithEnvironment sets up environment variables that shall be set for the command. func WithEnvironment(environment []string) Option { return func(cfg *config) { |