aboutsummaryrefslogtreecommitdiffstats
path: root/commands/account/rmdir.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/account/rmdir.go')
-rw-r--r--commands/account/rmdir.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/commands/account/rmdir.go b/commands/account/rmdir.go
index 6590a819..0793c7b8 100644
--- a/commands/account/rmdir.go
+++ b/commands/account/rmdir.go
@@ -5,6 +5,7 @@ import (
"time"
"git.sr.ht/~rjarry/aerc/app"
+ "git.sr.ht/~rjarry/aerc/models"
"git.sr.ht/~rjarry/aerc/worker/types"
)
@@ -31,6 +32,12 @@ func (r RemoveDir) Execute(args []string) error {
return errors.New("Refusing to remove non-empty directory; use -f")
}
+ if d := acct.Directories().SelectedDirectory(); d != nil {
+ if d.Role == models.VirtualRole {
+ return errors.New("Cannot remove a virtual node")
+ }
+ }
+
curDir := acct.SelectedDirectory()
var newDir string
dirFound := false