Skip to content

Commit e9573ee

Browse files
fix: running --shell without arguments
1 parent bf976f1 commit e9573ee

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/dockerized.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,12 @@ func main() {
151151

152152
runOptions.Environment = append(runOptions.Environment, "PS1="+ps1)
153153
runOptions.Entrypoint = []string{"/bin/sh"}
154-
runOptions.Command = []string{"-c", fmt.Sprintf("%s; %s \"%s\"", cmdPrintWelcome, cmdLaunchShell, strings.Join(commandArgs, "\" \""))}
154+
155+
if len(commandArgs) > 0 {
156+
runOptions.Command = []string{"-c", fmt.Sprintf("%s; %s \"%s\"", cmdPrintWelcome, cmdLaunchShell, strings.Join(commandArgs, "\" \""))}
157+
} else {
158+
runOptions.Command = []string{"-c", fmt.Sprintf("%s; %s", cmdPrintWelcome, cmdLaunchShell)}
159+
}
155160
}
156161

157162
if !contains(project.ServiceNames(), commandName) {

0 commit comments

Comments
 (0)