marcusbuffett / pipe-rename

Rename your files using your favorite text editor
https://crates.io/crates/pipe-rename
MIT License
397 stars 12 forks source link

`--rename-command` is broken for commands with arguments #68

Closed mtimkovich closed 1 year ago

mtimkovich commented 1 year ago

E.g:

$ renamer -c 'git mv' Cargo.toml 

The following replacements were found:

Cargo.toml -> Cargo.json

Execute these renames?: Yes
Error: No such file or directory (os error 2)

Caused by:
    No such file or directory (os error 2)

I think reverting back to

subprocess::Exec::shell(format!(
    "{} {} {}",
    cmd,
    escape(Cow::from(replacement.original.clone())),
    escape(Cow::from(replacement.new.clone()))
))
.join()?;

should fix it.