diff --git a/os.go b/os.go index 124b8c9..1fc896d 100644 --- a/os.go +++ b/os.go @@ -114,31 +114,6 @@ func shellCommand(s string, args []string) *exec.Cmd { return exec.Command(gOpts.shell, args...) } -func pasteCommand(list []string, dstDir string, cp bool) *exec.Cmd { - var sh string - var args []string - - if cp { - sh = "cp" - args = append(args, "-R") - } else { - sh = "mv" - } - - // XXX: POSIX standard states that -i flag shall do nothing when the - // response is not affirmative. Since this command is run with a nil - // stdin, it should not give an affirmative answer and in return this - // command should not overwrite existing files. Our intention here is - // to use the standard -i flag in place of non-standard -n flag to - // avoid overwrites. - args = append(args, "-i") - - args = append(args, list...) - args = append(args, dstDir) - - return exec.Command(sh, args...) -} - func setDefaults() { gOpts.cmds["open"] = &execExpr{"&", `$OPENER "$f"`} gOpts.keys["e"] = &execExpr{"$", `$EDITOR "$f"`} diff --git a/os_windows.go b/os_windows.go index 1438e18..ced978b 100644 --- a/os_windows.go +++ b/os_windows.go @@ -89,33 +89,6 @@ func shellCommand(s string, args []string) *exec.Cmd { return exec.Command(gOpts.shell, args...) } -func pasteCommand(list []string, dstDir string, cp bool) *exec.Cmd { - var args []string - - sh := "robocopy" - if !cp { - args = []string{"/move"} - } - for _, f := range list { - stat, err := os.Stat(f) - if err != nil { - log.Printf("getting file information: %s", err) - continue - } - base := filepath.Base(f) - dest := filepath.Dir(f) - if stat.IsDir() { - exec.Command(sh, append(args, f, filepath.Join(dstDir, base))...).Run() - } else { - exec.Command(sh, append(args, dest, dstDir, base)...).Run() - } - } - - // TODO: return 0 on success - - return exec.Command(sh, args...) -} - func setDefaults() { gOpts.cmds["open"] = &execExpr{"&", "%OPENER% %f%"} gOpts.keys["e"] = &execExpr{"$", "%EDITOR% %f%"}