From 9b98505454fa0a5128fd34845448b3aa25e1c43f Mon Sep 17 00:00:00 2001 From: Kenvin Davies Date: Sat, 4 Jul 2020 11:37:40 +0100 Subject: [PATCH] build: ensure paths with spaces can be used 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.) PR-URL: https://github.com/nodejs/node-addon-api/pull/757 Reviewed-By: Michael Dawson Reviewed-By: Nicola Del Gobbo --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 393fa34..75b96e0 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 };