trash files instead of containing dir
oops
This commit is contained in:
parent
3e3b97b2c1
commit
2e82cd2388
|
@ -26,6 +26,7 @@ type Files []File
|
||||||
|
|
||||||
func (f File) Name() string { return f.name }
|
func (f File) Name() string { return f.name }
|
||||||
func (f File) Path() string { return f.path }
|
func (f File) Path() string { return f.path }
|
||||||
|
func (f File) Filename() string { return filepath.Join(f.path, f.name) }
|
||||||
func (f File) Modified() time.Time { return f.modified }
|
func (f File) Modified() time.Time { return f.modified }
|
||||||
func (f File) Filesize() int64 { return f.filesize }
|
func (f File) Filesize() int64 { return f.filesize }
|
||||||
|
|
||||||
|
|
4
main.go
4
main.go
|
@ -90,8 +90,8 @@ var (
|
||||||
if confirm(fmt.Sprintf("trash these %d files?", len(fls))) {
|
if confirm(fmt.Sprintf("trash these %d files?", len(fls))) {
|
||||||
tfs := make([]string, 0, len(fls))
|
tfs := make([]string, 0, len(fls))
|
||||||
for _, file := range fls {
|
for _, file := range fls {
|
||||||
log.Debugf("gonna trash %s", file.Path())
|
log.Debugf("gonna trash %s", file.Filename())
|
||||||
tfs = append(tfs, file.Path())
|
tfs = append(tfs, file.Filename())
|
||||||
}
|
}
|
||||||
|
|
||||||
trashed, err := trash.TrashFiles(trashDir, tfs...)
|
trashed, err := trash.TrashFiles(trashDir, tfs...)
|
||||||
|
|
Loading…
Reference in a new issue