Skip to content

Commit

Permalink
emptyTrash: only do deletion preview if canPrompt
Browse files Browse the repository at this point in the history
  • Loading branch information
odeke-em committed Aug 14, 2015
1 parent 9328348 commit 9a4b47f
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/trash.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,20 @@ func (g *Commands) EmptyTrash() error {
spin.play()
defer spin.stop()

travSt := traversalSt{
depth: -1,
file: rootFile,
headPath: "/",
inTrash: true,
mask: g.opts.TypeMask,
explicitNoPrompt: true,
}
if g.opts.canPrompt() {
travSt := traversalSt{
depth: -1,
file: rootFile,
headPath: "/",
inTrash: true,
mask: g.opts.TypeMask,
explicitNoPrompt: true,
}

if !g.breadthFirst(travSt, spin) {
return nil
}
if !g.breadthFirst(travSt, spin) {
return nil
}

if g.opts.canPrompt() {
g.log.Logln("This operation is irreversible. Empty trash! ")

if !promptForChanges() {
Expand Down

0 comments on commit 9a4b47f

Please sign in to comment.