Skip to content

Commit ba5f7a6

Browse files
committed
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: nodejs/node-addon-api#757 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@gmail.com>
1 parent e399318 commit ba5f7a6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
const path = require('path');
22

3+
const include = path.relative('.', __dirname);
4+
35
module.exports = {
4-
include: `"${__dirname}"`,
5-
gyp: path.join(__dirname, 'node_api.gyp:nothing'),
6+
include: include,
7+
gyp: path.join(include, 'node_api.gyp:nothing'),
68
isNodeApiBuiltin: true,
79
needsFlag: false
810
};

0 commit comments

Comments
 (0)