We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9776220 commit 94dec01Copy full SHA for 94dec01
tools/updatenan.js
@@ -1,9 +1,8 @@
1
const spawn = require('child_process').spawn
2
const existsSync = require('fs').existsSync
3
-
+const nanPath = existsSync('./node_modules/nan/nan.h') ? './node_modules/nan/nan.h' : '../nan/nan.h'
4
if (process.platform === 'win32') {
5
- const nanPath = existsSync('./node_modules/nan/nan.h') ? './node_modules/nan/nan.h' : '../nan/nan.h'
6
spawn('powershell', ['-Command', `(Get-Content -Raw ${nanPath}) -replace '#include \"nan_scriptorigin.h\"', '// #include \"nan_scriptorigin.h\"' | Out-File -Encoding Utf8 ${nanPath}`], { stdio: 'inherit' })
7
} else {
8
- spawn('sed', ['-i', '-e', 's/^#include .nan_scriptorigin\\.h./\\/\\/ #include nan_scriptorigin.h/', './node_modules/nan/nan.h'], { stdio: 'inherit' })
+ spawn('sed', ['-i', '-e', 's/^#include .nan_scriptorigin\\.h./\\/\\/ #include nan_scriptorigin.h/', nanPath], { stdio: 'inherit' })
9
}
0 commit comments