Skip to content

Commit

Permalink
Fix path resolving
Browse files Browse the repository at this point in the history
  • Loading branch information
JezerM committed Jan 6, 2022
1 parent 09a4e9a commit daca61d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions build/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ async function wait(ms) {
}

function getFileSize(ph) {
let buf = child_process.execSync("du -sb " + ph, { encoding: "utf-8" });
let buf = child_process.execSync(`du -sb "${ph}"`, { encoding: "utf-8" });

let match = buf.match(/^(\d+)/);
return Number(match[0]);
Expand Down Expand Up @@ -67,8 +67,8 @@ async function iterateCopy(source, dest, copy_bar, bytes) {

let stat = fs.statSync(source);
if (!stat.isDirectory()) {
let source_file = source;
let dest_file = dest;
let source_file = path.resolve(source);
let dest_file = path.resolve(dest);
return await do_copy(source_file, dest_file, copy_bar, bytesCopied);
}
if (!fs.pathExistsSync(dest)) fs.mkdirSync(dest, { recursive: true });
Expand Down

0 comments on commit daca61d

Please sign in to comment.