Fix site cloning into reserved directories on Node 24
DC CMS qualification / qualify (push) Successful in 1m34s

This commit is contained in:
DCCONSTRUCTIONS
2026-11-05 10:24:46 +03:00
parent 4369f0a0cb
commit e9093da9b2
3 changed files with 25 additions and 2 deletions
+4 -1
View File
@@ -87,7 +87,10 @@ async function createSite(payload) {
await mkdir(root); // Reservation: never overwrite an existing tree.
source.writes++;
try {
await cp(source.root, root, {
if ((await lstat(source.root)).isSymbolicLink()) throw fail("Копирование сайта с символическими ссылками не поддерживается");
// The destination root is our reservation. Node 24 rejects cp onto an
// existing directory with errorOnExist, so copy its children separately.
for (const entry of await readdir(source.root)) await cp(join(source.root, entry), join(root, entry), {
recursive: true, force: false, errorOnExist: true,
filter: async path => {
const parts = relative(source.root, path).split(/[\\/]/);