From c0ca06511b4ea8ef2d50245536a49e1e0b6c7306 Mon Sep 17 00:00:00 2001 From: Roy Wright 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 };