1
0
Fork 0

Correctly handle empty workdir

master
dump_stack() 2023-04-07 17:46:36 +00:00
parent c3cf25e523
commit a4f2a31819
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC
1 changed files with 6 additions and 1 deletions

View File

@ -200,7 +200,12 @@ func (c container) Run(workdir string, command string) (output string, err error
if c.Volumes.Boot != "" {
args = append(args, "-v", c.Volumes.Boot+":/boot")
}
args = append(args, c.name, "bash", "-c", "cd /work && "+command)
args = append(args, c.name, "bash", "-c")
if workdir != "" {
args = append(args, "cd /work && "+command)
} else {
args = append(args, command)
}
cmd := exec.Command("docker", args...)