From 68455b6ec08a37c6d95475c59d4975e7516f3b83 Mon Sep 17 00:00:00 2001 From: Minggang Wang Date: Fri, 16 Jan 2026 13:22:35 +0800 Subject: [PATCH] Leverage fs.stat to ensure it works by Electron package --- lib/utils.js | 2 +- rosidl_gen/packages.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/utils.js b/lib/utils.js index cf104ded..802d26c1 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -54,7 +54,7 @@ function ensureDirSync(dirPath) { */ async function pathExists(filePath) { try { - await fsPromises.access(filePath); + await fsPromises.stat(filePath); return true; } catch { return false; diff --git a/rosidl_gen/packages.js b/rosidl_gen/packages.js index ee37461c..02dc9c65 100644 --- a/rosidl_gen/packages.js +++ b/rosidl_gen/packages.js @@ -223,7 +223,7 @@ async function findPackagesInDirectory(dir, useIDL) { // If there is a folder named 'share' under the root path, we consider that // the ament build tool has been executed and |amentExecuted| will be true. - fs.access(path.join(dir, 'share'), (err) => { + fs.stat(path.join(dir, 'share'), (err) => { if (err) { amentExecuted = false; }