mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-25 08:31:03 +00:00
Fix execute shell command to take into account edge cases
This commit is contained in:
parent
080512d58d
commit
efc1122343
1 changed files with 1 additions and 1 deletions
|
|
@ -533,7 +533,7 @@ func (gui *Gui) containerExecShell(container *commands.Container) error {
|
|||
})
|
||||
|
||||
// TODO: use SDK
|
||||
resolvedCommand := utils.ApplyTemplate("docker exec -it {{ .Container.ID }} /bin/sh -c 'eval $(grep ^$(id -un): /etc/passwd | cut -d : -f 7-)'", commandObject)
|
||||
resolvedCommand := utils.ApplyTemplate("docker exec -it {{ .Container.ID }} /bin/sh -c 'eval $( (grep ^[^:]*:[^:]*:$(id -u): /etc/passwd || echo \"::::::/bin/sh\") | cut -d : -f 7-) || eval $(echo \"/bin/sh\")'", commandObject)
|
||||
// attach and return the subprocess error
|
||||
cmd := gui.OSCommand.ExecutableFromString(resolvedCommand)
|
||||
return gui.runSubprocess(cmd)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue