1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

ln -i: adjust the behavior to match the GNU change

Just like mv & cp

Matches the change upstream
7a69df88999bedd8e9fccf9f3dfa9ac6907fab66
This commit is contained in:
Sylvestre Ledru 2023-03-25 11:21:39 +01:00
parent d0a4059f34
commit 9d54ed02a8
2 changed files with 2 additions and 2 deletions

View file

@ -392,7 +392,7 @@ fn link(src: &Path, dst: &Path, settings: &Settings) -> UResult<()> {
OverwriteMode::NoClobber => {}
OverwriteMode::Interactive => {
if !prompt_yes!("overwrite {}?", dst.quote()) {
return Ok(());
return Err(LnError::SomeLinksFailed.into());
}
if fs::remove_file(dst).is_ok() {};

View file

@ -116,7 +116,7 @@ fn test_symlink_interactive() {
.ucmd()
.args(&["-i", "-s", file, link])
.pipe_in("n")
.succeeds()
.fails()
.no_stdout();
assert!(at.file_exists(file));