From 40c79263421d21d92199cbbef0533f42a434d4f4 Mon Sep 17 00:00:00 2001 From: Lovell Fuller 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 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 };