Skip to content

Commit

Permalink
move to script
Browse files Browse the repository at this point in the history
  • Loading branch information
jackkav committed Jan 9, 2025
1 parent 84f4870 commit 9878a83
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 0 additions & 7 deletions scripts/ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -339,15 +339,8 @@ echo "node-gyp version: $(npm ls node-gyp -g)"
# https://github.com/nodejs/node-gyp/blob/main/docs/Updating-npm-bundled-node-gyp.md
# npm explore npm/node_modules/@npmcli/run-script -g -- npm_config_global=false npm install [email protected]




npm ci

# patch nan.h https://github.com/nodejs/nan/issues/978
sed 's/^#include .nan_scriptorigin\.h./\/\/ #include nan_scriptorigin.h/' ./node_modules/nan/nan.h > ./node_modules/nan/nan.h.new && mv ./node_modules/nan/nan.h.new ./node_modules/nan/nan.h


echo "node-gyp version: $(npm ls node-gyp -g)"


Expand Down
10 changes: 10 additions & 0 deletions scripts/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,13 @@ if (require.main === module) {
}
})
}

// https://github.com/nodejs/nan/issues/978
const filePath = path.join(__dirname, '../node_modules/nan/nan.h')
const fileContent = fs.readFileSync(filePath, 'utf8')
const updatedContent = fileContent.replace(
/#include "nan_scriptorigin.h"/,
'// #include "nan_scriptorigin.h"',
)

fs.writeFileSync(filePath, updatedContent, 'utf8')

0 comments on commit 9878a83

Please sign in to comment.