Skip to content

Commit

Permalink
build: ensure paths with spaces can be used
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-By: Nicola Del Gobbo <[email protected]>
Marlyfleitas committed Jul 8, 2020
1 parent e399318 commit ba5f7a6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -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
};

0 comments on commit ba5f7a6

Please sign in to comment.