use recursive and backup options for paste

This commit is contained in:
Gokcehan 2016-09-13 22:56:03 +03:00
parent 9c2f594a6b
commit 57bebef804

7
nav.go
View File

@ -387,15 +387,20 @@ func (nav *Nav) paste() error {
dir := nav.currDir()
args := append(list, dir.path)
var args []string
var sh string
if keep {
sh = "cp"
args = append(args, "-r")
} else {
sh = "mv"
}
args = append(args, "--backup=numbered")
args = append(args, list...)
args = append(args, dir.path)
cmd := exec.Command(sh, args...)
if err := cmd.Run(); err != nil {