fix(assemble): skip rm step in dry-run mode

dryRun was misrouted into RmOptions.NoTTY, so `assemble rm --dry-run`
and `assemble create --replace --dry-run` actually deleted containers.
Match the shell which skips rm entirely (distrobox-assemble:316-319).

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
This commit is contained in:
Luca Di Maio committed 2026-06-25 09:07:23 +02:00
1 parent 9860650b3d
commit 07df5ad96b
1 file changed
+8 -1
+8 -1
View File
@@ -100,8 +100,15 @@ func (ac *AssembleCommand) Execute(ctx context.Context, opts AssembleOptions) er
func (ac *AssembleCommand) deleteItem(ctx context.Context, item manifest.Item, dryRun bool) error {
ac.progress.Next("Deleting %s...", item.Name)
// Shell skips the rm step entirely in dry-run (distrobox-assemble:316-319):
// `assemble rm --dry-run` and `assemble create --replace --dry-run` must not
// actually delete the container.
if dryRun {
ac.progress.Done()
return nil
}
opts := RmOptions{
NoTTY: dryRun,
NoTTY: true, // assemble is non-interactive
Force: true,
All: false,
RemoveHome: false,