Skip to content

Commit

Permalink
Fix: Create target directory when copying (#1030)
Browse files Browse the repository at this point in the history
Fix: Allow building with space in path
  • Loading branch information
felixrieseberg authored Sep 2, 2023
1 parent 0092d43 commit 5f7f4d0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions deps/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ for (const { filename, optional } of files) {
if (optional && !fs.existsSync(path.join(source, filename))) {
continue;
}

fs.accessSync(path.join(source, filename));

// Ensure destination folder exists
const destFolder = path.dirname(path.join(dest, filename));
fs.mkdirSync(destFolder, { recursive: true });

// Copy file over
fs.copyFileSync(path.join(source, filename), path.join(dest, filename));
}

0 comments on commit 5f7f4d0

Please sign in to comment.