mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
fs: fix wrong order of file names in cpSync error message
PR-URL: https://github.com/nodejs/node/pull/59775 Reviewed-By: Dario Piotrowicz <dario.piotrowicz@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
ce08561b67
commit
f855cda2a2
|
|
@ -3270,7 +3270,7 @@ static void CpSyncCheckPaths(const FunctionCallbackInfo<Value>& args) {
|
||||||
std::string message =
|
std::string message =
|
||||||
"Cannot overwrite non-directory %s with directory %s";
|
"Cannot overwrite non-directory %s with directory %s";
|
||||||
return THROW_ERR_FS_CP_DIR_TO_NON_DIR(
|
return THROW_ERR_FS_CP_DIR_TO_NON_DIR(
|
||||||
env, message.c_str(), src_path_str, dest_path_str);
|
env, message.c_str(), dest_path_str, src_path_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!src_is_dir && dest_is_dir) {
|
if (!src_is_dir && dest_is_dir) {
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,11 @@ if (isInsideDirWithUnusualChars) {
|
||||||
tmpdir.refresh();
|
tmpdir.refresh();
|
||||||
|
|
||||||
{
|
{
|
||||||
const src = nextdir();
|
const src = nextdir('FIRST_DIRECTORY');
|
||||||
mkdirSync(src, mustNotMutateObjectDeep({ recursive: true }));
|
mkdirSync(src, mustNotMutateObjectDeep({ recursive: true }));
|
||||||
const dest = fixtures.path('copy/kitchen-sink/README.md');
|
const dest = fixtures.path('copy/kitchen-sink/README.md');
|
||||||
assert.throws(
|
assert.throws(
|
||||||
() => cpSync(src, dest),
|
() => cpSync(src, dest),
|
||||||
{ code: 'ERR_FS_CP_DIR_TO_NON_DIR' }
|
{ code: 'ERR_FS_CP_DIR_TO_NON_DIR', message: /non-directory .*README\.md with directory .*FIRST_DIRECTORY/ }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user