Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 30dbdf7

Browse files
committed
install: fix the error message
should fix: tests/install/basic-1.sh
1 parent 3eda102 commit 30dbdf7

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/uu/install/locales/en-US.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ install-help-default-context = set SELinux security context of destination file
2222
2323
# Error messages
2424
install-error-dir-needs-arg = { $util_name } with -d requires at least one argument.
25-
install-error-create-dir-failed = failed to create { $path }
25+
install-error-create-dir-failed = cannot create directory { $path }
2626
install-error-chmod-failed = failed to chmod { $path }
2727
install-error-chmod-failed-detailed = { $path }: chmod failed with error { $error }
2828
install-error-chown-failed = failed to chown { $path }: { $error }

src/uu/install/src/install.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ fn directory(paths: &[OsString], b: &Behavior) -> UResult<()> {
472472
// the default mode. Hence it is safe to use fs::create_dir_all
473473
// and then only modify the target's dir mode.
474474
if let Err(e) = fs::create_dir_all(path_to_create.as_path())
475-
.map_err_context(|| path_to_create.as_path().maybe_quote().to_string())
475+
.map_err_context(|| translate!("install-error-create-dir-failed", "path" => path_to_create.as_path().quote()))
476476
{
477477
show!(e);
478478
continue;

tests/by-util/test_install.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ fn test_install_creating_leading_dir_fails_on_long_name() {
10131013
.arg(source)
10141014
.arg(at.plus(target.as_str()))
10151015
.fails()
1016-
.stderr_contains("failed to create");
1016+
.stderr_contains("cannot create directory");
10171017
}
10181018

10191019
#[test]

0 commit comments

Comments
 (0)