From 45df0e6feb6f2c05fd9e3c0086512484e33bc41a Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Sat, 4 Jul 2020 11:37:40 +0100 Subject: [PATCH] Ensure include path is relative to process working directory (PWD) This allows the use of parent paths that contain whitespace, plus keeps the approach consistent with that used by nan. (The previous approach of adding double quotes did not work as intended due to node-gyp removing these on the way through.) --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 393fa348e..75b96e0ed 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,10 @@ const path = require('path'); +const include = path.relative('.', __dirname); + module.exports = { - include: `"${__dirname}"`, - gyp: path.join(__dirname, 'node_api.gyp:nothing'), + include: include, + gyp: path.join(include, 'node_api.gyp:nothing'), isNodeApiBuiltin: true, needsFlag: false };