Skip to content

Commit

Permalink
Change workDir capitalization
Browse files Browse the repository at this point in the history
  • Loading branch information
silphid committed Jun 1, 2021
1 parent 3a4a83f commit d28d867
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/cmd/run/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func run(ctx context.Context, name string, options Options) error {

var runOptions []docker.RunOption
if workDir != "" {
runOptions = append(runOptions, docker.WithWorkdir(workDir))
runOptions = append(runOptions, docker.WithWorkDir(workDir))
}

return docker.Start(ctx, yeyContext, containerName, runOptions...)
Expand Down
14 changes: 7 additions & 7 deletions src/internal/docker/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import (
)

type runOptions struct {
workdir string
workDir string
}

type RunOption func(*runOptions)

func WithWorkdir(wd string) RunOption {
func WithWorkDir(wd string) RunOption {
return func(ro *runOptions) {
ro.workdir = wd
ro.workDir = wd
}
}

Expand Down Expand Up @@ -158,8 +158,8 @@ func runContainer(ctx context.Context, yeyCtx yey.Context, containerName string,
args = append(args, "--rm")
}

if options.workdir != "" {
args = append(args, "--workdir", options.workdir)
if options.workDir != "" {
args = append(args, "--workdir", options.workDir)
}

args = append(args, yeyCtx.Image)
Expand All @@ -174,8 +174,8 @@ func startContainer(ctx context.Context, containerName string) error {

func execContainer(ctx context.Context, containerName string, cmd []string, options runOptions) error {
args := []string{"exec", "-ti"}
if options.workdir != "" {
args = append(args, "--workdir", options.workdir)
if options.workDir != "" {
args = append(args, "--workdir", options.workDir)
}
args = append(args, containerName)
args = append(args, cmd...)
Expand Down

0 comments on commit d28d867

Please sign in to comment.