forked from TrueCloudLab/rclone
ncdu: fix deleting files
This commit is contained in:
parent
84e21ade6b
commit
369a8ee17b
1 changed files with 2 additions and 9 deletions
|
@ -424,20 +424,13 @@ func (u *UI) removeEntry(pos int) {
|
||||||
func (u *UI) delete() {
|
func (u *UI) delete() {
|
||||||
dirPos := u.sortPerm[u.dirPosMap[u.path].entry]
|
dirPos := u.sortPerm[u.dirPosMap[u.path].entry]
|
||||||
entry := u.entries[dirPos]
|
entry := u.entries[dirPos]
|
||||||
|
|
||||||
file := false
|
|
||||||
d, _ := u.d.GetDir(dirPos)
|
|
||||||
if d == nil {
|
|
||||||
file = true
|
|
||||||
}
|
|
||||||
|
|
||||||
u.boxMenu = []string{"cancel", "confirm"}
|
u.boxMenu = []string{"cancel", "confirm"}
|
||||||
if file {
|
if obj, isFile := entry.(fs.Object); isFile {
|
||||||
u.boxMenuHandler = func(f fs.Fs, p string, o int) (string, error) {
|
u.boxMenuHandler = func(f fs.Fs, p string, o int) (string, error) {
|
||||||
if o != 1 {
|
if o != 1 {
|
||||||
return "Aborted!", nil
|
return "Aborted!", nil
|
||||||
}
|
}
|
||||||
err := f.Rmdir(entry.String())
|
err := operations.DeleteFile(obj)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue