(npm, arb)
| 6 | const { resolve } = require('node:path') |
| 7 | |
| 8 | const reifyFinish = async (npm, arb) => { |
| 9 | // if we are using a builtin config, and just installed npm as a top-level global package, we have to preserve that config. |
| 10 | if (arb.options.global) { |
| 11 | const npmNode = arb.actualTree.inventory.get('node_modules/npm') |
| 12 | if (npmNode) { |
| 13 | const builtinConf = npm.config.data.get('builtin') |
| 14 | if (!builtinConf.loadError) { |
| 15 | const content = ini.stringify(builtinConf.raw).trim() + '\n' |
| 16 | await writeFile(resolve(npmNode.path, 'npmrc'), content) |
| 17 | } |
| 18 | } |
| 19 | } |
| 20 | warnWorkspaceAllowScripts(arb.actualTree) |
| 21 | const unreviewedScripts = await checkAllowScripts({ arb, npm }) |
| 22 | reifyOutput(npm, arb, { unreviewedScripts }) |
| 23 | } |
| 24 | |
| 25 | module.exports = reifyFinish |
no test coverage detected