diff options
author | Kat Marchán <kzm@sykosomatic.org> | 2016-12-18 20:22:09 -0800 |
---|---|---|
committer | Myles Borins <myles.borins@gmail.com> | 2016-12-28 15:30:50 -0500 |
commit | 9946519fba73687d34dccd5813808252a1973f3c (patch) | |
tree | 74d7194d2a00743bcd905027195e7e8000c5ac5a /deps/npm/lib/install/action/prepare.js | |
parent | 4d3b487b791606ea965f6280ce0eeea03d79b660 (diff) | |
download | android-node-v8-9946519fba73687d34dccd5813808252a1973f3c.tar.gz android-node-v8-9946519fba73687d34dccd5813808252a1973f3c.tar.bz2 android-node-v8-9946519fba73687d34dccd5813808252a1973f3c.zip |
deps: upgrade npm to 4.0.5
PR-URL: https://github.com/nodejs/node/pull/10330
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'deps/npm/lib/install/action/prepare.js')
-rw-r--r-- | deps/npm/lib/install/action/prepare.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/deps/npm/lib/install/action/prepare.js b/deps/npm/lib/install/action/prepare.js new file mode 100644 index 0000000000..771a2a9399 --- /dev/null +++ b/deps/npm/lib/install/action/prepare.js @@ -0,0 +1,27 @@ +'use strict' +var chain = require('slide').chain +var lifecycle = require('../../utils/lifecycle.js') +var packageId = require('../../utils/package-id.js') +var prepublishWarning = require('../../utils/warn-deprecated.js')('prepublish-on-install') +var moduleStagingPath = require('../module-staging-path.js') + +module.exports = function (staging, pkg, log, next) { + log.silly('prepublish', packageId(pkg)) + // TODO: for `npm@5`, change the behavior and remove this warning. + // see https://github.com/npm/npm/issues/10074 for details + if (pkg.package && pkg.package.scripts && pkg.package.scripts.prepublish) { + prepublishWarning([ + 'As of npm@5, `prepublish` scripts will run only for `npm publish`.', + '(In npm@4 and previous versions, it also runs for `npm install`.)', + 'See the deprecation note in `npm help scripts` for more information.' + ]) + } + var buildpath = moduleStagingPath(staging, pkg) + chain( + [ + [lifecycle, pkg.package, 'prepublish', buildpath, false, false], + [lifecycle, pkg.package, 'prepare', buildpath, false, false] + ], + next + ) +} |