mirror of
https://github.com/89luca89/distrobox.git
synced 2026-11-02 20:30:16 -06:00
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:
1 file changed
+8
-1
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user