mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07: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:
+1
-1
@@ -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() {};
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user