mirror of
https://github.com/89luca89/distrobox.git
synced 2026-08-17 16:34:42 -05:00
fix(rm): use Container.IsRunning() for the force prompt
strings.Contains(container.Status, "Up") missed podman's lowercase
"running" status, leaving the force prompt unreachable under podman.
IsRunning() matches both docker ("Up …") and podman ("running").
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
This commit is contained in:
+1
-1
@@ -109,7 +109,7 @@ func (c *RmCommand) removeContainer(
|
||||
userHome string,
|
||||
) error {
|
||||
forceRemove := force
|
||||
if !forceRemove && !noTTY && strings.Contains(container.Status, "Up") {
|
||||
if !forceRemove && !noTTY && container.IsRunning() {
|
||||
// Shell defaults this prompt to "yes" (distrobox-rm:424-426).
|
||||
if c.prompter.Prompt("Container is running, do you want to force delete it?", true) {
|
||||
forceRemove = true
|
||||
|
||||
Reference in New Issue
Block a user