Skip to content

Commit

Permalink
fix windows builds using npm-run-path
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangruber committed Oct 30, 2017
1 parent 2a6125f commit 8607b5e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
7 changes: 5 additions & 2 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
var spawn = require('cross-spawn')
var npmRunPath = require('npm-run-path')

var runtime = process.env.npm_config_runtime || 'node'
var target = process.env.npm_config_target || process.versions.node
var abi = process.env.npm_config_abi || process.versions.modules

console.log('BUILD for %s@%s (abi=%s)', runtime, target, abi)

var ps = spawn(`${__dirname}/node_modules/.bin/cmake-js`, [
var ps = spawn('cmake-js', [
'rebuild',
'-r', runtime,
'-v', target,
'--abi', abi
])
], {
env: npmRunPath.env()
})
ps.stdout.pipe(process.stdout)
ps.stderr.pipe(process.stderr)
ps.on('exit', function (code) {
Expand Down
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"dependencies": {
"cmake-js": "^3.5.0",
"cross-spawn": "^5.1.0",
"nan": "^2.4.0"
"nan": "^2.4.0",
"npm-run-path": "^2.0.2"
},
"devDependencies": {
"mkdirp": "^0.5.1",
Expand Down

0 comments on commit 8607b5e

Please sign in to comment.