Skip to content

Commit 973a004

Browse files
authored
fix: Ensure parent directories of symlinks are created (#7327)
1 parent 9b265f4 commit 973a004

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.changeset/violet-seahorses-wait.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"app-builder-lib": patch
3+
---
4+
5+
fix: Ensure parent directories of symlinks are created when copied directory only contains symlinks

packages/app-builder-lib/src/util/appFileCopier.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import BluebirdPromise from "bluebird-lst"
22
import { AsyncTaskManager, log } from "builder-util"
33
import { CONCURRENCY, FileCopier, FileTransformer, Link, MAX_FILE_REQUESTS, statOrNull, walk } from "builder-util/out/fs"
44
import { Stats } from "fs"
5-
import { mkdir, readlink, symlink } from "fs/promises"
5+
import { mkdir, readlink } from "fs/promises"
6+
import { ensureSymlink } from "fs-extra"
67
import * as path from "path"
78
import { isLibOrExe } from "../asar/unpackDetector"
89
import { Platform } from "../core"
@@ -82,7 +83,7 @@ export async function copyAppFiles(fileSet: ResolvedFileSet, packager: Packager,
8283
await taskManager.awaitTasks()
8384
}
8485
if (links.length > 0) {
85-
await BluebirdPromise.map(links, it => symlink(it.link, it.file), CONCURRENCY)
86+
await BluebirdPromise.map(links, it => ensureSymlink(it.link, it.file), CONCURRENCY)
8687
}
8788
}
8889

0 commit comments

Comments
 (0)