Commit 62d21d8
committed
fix: show only running containers in force-delete prompt
Previously, when deleting multiple containers with `distrobox-rm`, if any
container was running, the prompt incorrectly showed the entire container
list instead of just the running containers.
This fix:
- Collects all running container names first
- Shows only running containers in the force-delete prompt
- Asks once for all running containers (preserving original behavior)
- If user refuses, continues without force flag (running containers will fail)
- Exits on invalid input instead of continuing with deletion
Signed-off-by: xz-dev <xiangzhedev@gmail.com>1 parent 2995df5 commit 62d21d8
1 file changed
Lines changed: 21 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
| 421 | + | |
| 422 | + | |
421 | 423 | | |
422 | 424 | | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
430 | 437 | | |
431 | 438 | | |
432 | 439 | | |
433 | | - | |
| 440 | + | |
434 | 441 | | |
435 | 442 | | |
436 | 443 | | |
437 | | - | |
438 | 444 | | |
439 | | - | |
440 | | - | |
441 | | - | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
442 | 449 | | |
443 | 450 | | |
| 451 | + | |
444 | 452 | | |
445 | 453 | | |
446 | | - | |
| 454 | + | |
447 | 455 | | |
448 | 456 | | |
449 | 457 | | |
| |||
0 commit comments