Skip to content

Commit 94dec01

Browse files
committed
apply the fix not only for win32
1 parent 9776220 commit 94dec01

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tools/updatenan.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
const spawn = require('child_process').spawn
22
const existsSync = require('fs').existsSync
3-
3+
const nanPath = existsSync('./node_modules/nan/nan.h') ? './node_modules/nan/nan.h' : '../nan/nan.h'
44
if (process.platform === 'win32') {
5-
const nanPath = existsSync('./node_modules/nan/nan.h') ? './node_modules/nan/nan.h' : '../nan/nan.h'
65
spawn('powershell', ['-Command', `(Get-Content -Raw ${nanPath}) -replace '#include \"nan_scriptorigin.h\"', '// #include \"nan_scriptorigin.h\"' | Out-File -Encoding Utf8 ${nanPath}`], { stdio: 'inherit' })
76
} else {
8-
spawn('sed', ['-i', '-e', 's/^#include .nan_scriptorigin\\.h./\\/\\/ #include nan_scriptorigin.h/', './node_modules/nan/nan.h'], { stdio: 'inherit' })
7+
spawn('sed', ['-i', '-e', 's/^#include .nan_scriptorigin\\.h./\\/\\/ #include nan_scriptorigin.h/', nanPath], { stdio: 'inherit' })
98
}

0 commit comments

Comments
 (0)