use recursive and backup options for paste
This commit is contained in:
parent
9c2f594a6b
commit
57bebef804
7
nav.go
7
nav.go
@ -387,15 +387,20 @@ func (nav *Nav) paste() error {
|
|||||||
|
|
||||||
dir := nav.currDir()
|
dir := nav.currDir()
|
||||||
|
|
||||||
args := append(list, dir.path)
|
var args []string
|
||||||
|
|
||||||
var sh string
|
var sh string
|
||||||
if keep {
|
if keep {
|
||||||
sh = "cp"
|
sh = "cp"
|
||||||
|
args = append(args, "-r")
|
||||||
} else {
|
} else {
|
||||||
sh = "mv"
|
sh = "mv"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
args = append(args, "--backup=numbered")
|
||||||
|
args = append(args, list...)
|
||||||
|
args = append(args, dir.path)
|
||||||
|
|
||||||
cmd := exec.Command(sh, args...)
|
cmd := exec.Command(sh, args...)
|
||||||
|
|
||||||
if err := cmd.Run(); err != nil {
|
if err := cmd.Run(); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user