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:
parent
d0a4059f34
commit
9d54ed02a8
2 changed files with 2 additions and 2 deletions
|
@ -392,7 +392,7 @@ fn link(src: &Path, dst: &Path, settings: &Settings) -> UResult<()> {
|
||||||
OverwriteMode::NoClobber => {}
|
OverwriteMode::NoClobber => {}
|
||||||
OverwriteMode::Interactive => {
|
OverwriteMode::Interactive => {
|
||||||
if !prompt_yes!("overwrite {}?", dst.quote()) {
|
if !prompt_yes!("overwrite {}?", dst.quote()) {
|
||||||
return Ok(());
|
return Err(LnError::SomeLinksFailed.into());
|
||||||
}
|
}
|
||||||
|
|
||||||
if fs::remove_file(dst).is_ok() {};
|
if fs::remove_file(dst).is_ok() {};
|
||||||
|
|
|
@ -116,7 +116,7 @@ fn test_symlink_interactive() {
|
||||||
.ucmd()
|
.ucmd()
|
||||||
.args(&["-i", "-s", file, link])
|
.args(&["-i", "-s", file, link])
|
||||||
.pipe_in("n")
|
.pipe_in("n")
|
||||||
.succeeds()
|
.fails()
|
||||||
.no_stdout();
|
.no_stdout();
|
||||||
|
|
||||||
assert!(at.file_exists(file));
|
assert!(at.file_exists(file));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue