Skip to content

Commit

Permalink
fix: Ensure parent directories of symlinks are created (#7327)
Browse files Browse the repository at this point in the history
  • Loading branch information
gbodeen authored Dec 22, 2022
1 parent 9b265f4 commit 973a004
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/violet-seahorses-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"app-builder-lib": patch
---

fix: Ensure parent directories of symlinks are created when copied directory only contains symlinks
5 changes: 3 additions & 2 deletions packages/app-builder-lib/src/util/appFileCopier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import BluebirdPromise from "bluebird-lst"
import { AsyncTaskManager, log } from "builder-util"
import { CONCURRENCY, FileCopier, FileTransformer, Link, MAX_FILE_REQUESTS, statOrNull, walk } from "builder-util/out/fs"
import { Stats } from "fs"
import { mkdir, readlink, symlink } from "fs/promises"
import { mkdir, readlink } from "fs/promises"
import { ensureSymlink } from "fs-extra"
import * as path from "path"
import { isLibOrExe } from "../asar/unpackDetector"
import { Platform } from "../core"
Expand Down Expand Up @@ -82,7 +83,7 @@ export async function copyAppFiles(fileSet: ResolvedFileSet, packager: Packager,
await taskManager.awaitTasks()
}
if (links.length > 0) {
await BluebirdPromise.map(links, it => symlink(it.link, it.file), CONCURRENCY)
await BluebirdPromise.map(links, it => ensureSymlink(it.link, it.file), CONCURRENCY)
}
}

Expand Down

0 comments on commit 973a004

Please sign in to comment.