From e3b2ee183bc7497ec0432bc764678f5eda6495a7 Mon Sep 17 00:00:00 2001 From: snek Date: Mon, 10 Jun 2024 09:20:44 -0700 Subject: fix: Rewrite Node-API (#24101) Phase 1 node-api rewrite --- tools/util.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'tools') diff --git a/tools/util.js b/tools/util.js index 1497a2887..251aaa1fa 100644 --- a/tools/util.js +++ b/tools/util.js @@ -31,11 +31,17 @@ async function getFilesFromGit(baseDir, args) { throw new Error("gitLsFiles failed"); } - const files = output.split("\0").filter((line) => line.length > 0).map( - (filePath) => { - return Deno.realPathSync(join(baseDir, filePath)); - }, - ); + const files = output + .split("\0") + .filter((line) => line.length > 0) + .map((filePath) => { + try { + return Deno.realPathSync(join(baseDir, filePath)); + } catch { + return null; + } + }) + .filter((filePath) => filePath !== null); return files; } -- cgit v1.2.3