Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornlf <quitlahok@gmail.com>2021-02-22 20:15:56 +0300
committernlf <quitlahok@gmail.com>2021-02-22 20:15:56 +0300
commite606953e5795803a7c4eddb4ea993735ef65ec95 (patch)
treee639855f8a6e5b70f61cb79d0320a96304f9e9a3 /node_modules
parent9d81e0ceba7d69e0651662508415ee3705bddfd9 (diff)
libnpmversion@1.0.11
Diffstat (limited to 'node_modules')
-rw-r--r--node_modules/libnpmversion/lib/version.js57
-rw-r--r--node_modules/libnpmversion/package.json4
2 files changed, 41 insertions, 20 deletions
diff --git a/node_modules/libnpmversion/lib/version.js b/node_modules/libnpmversion/lib/version.js
index 309b9c2b9..31e6023f0 100644
--- a/node_modules/libnpmversion/lib/version.js
+++ b/node_modules/libnpmversion/lib/version.js
@@ -10,11 +10,6 @@ const commit = require('./commit.js')
const tag = require('./tag.js')
const runScript = require('@npmcli/run-script')
-const runner = opts => event => runScript({
- ...opts,
- stdio: 'inherit',
- event,
-})
module.exports = async (newversion, opts) => {
const {
@@ -64,17 +59,19 @@ module.exports = async (newversion, opts) => {
// returns false if we should not keep doing git stuff
const doGit = gitTagVersion && isGitDir && await enforceClean(opts)
- const runScript = ignoreScripts ? () => {} : runner({
- ...opts,
- pkg,
- env: {
- npm_old_version: current,
- npm_new_version: newV,
- },
- })
-
-
- await runScript('preversion')
+ if (!ignoreScripts) {
+ await runScript({
+ ...opts,
+ pkg,
+ stdio: 'inherit',
+ event: 'preversion',
+ banner: log.level !== 'silent',
+ env: {
+ npm_old_version: current,
+ npm_new_version: newV,
+ },
+ })
+ }
// - update the files
pkg.version = newV
@@ -96,7 +93,19 @@ module.exports = async (newversion, opts) => {
} catch (er) {}
}
- await runScript('version')
+ if (!ignoreScripts) {
+ await runScript({
+ ...opts,
+ pkg,
+ stdio: 'inherit',
+ event: 'version',
+ banner: log.level !== 'silent',
+ env: {
+ npm_old_version: current,
+ npm_new_version: newV,
+ },
+ })
+ }
if (doGit) {
// - git add, git commit, git tag
@@ -110,7 +119,19 @@ module.exports = async (newversion, opts) => {
} else
log.verbose('version', 'Not tagging: not in a git repo or no git cmd')
- await runScript('postversion')
+ if (!ignoreScripts) {
+ await runScript({
+ ...opts,
+ pkg,
+ stdio: 'inherit',
+ event: 'postversion',
+ banner: log.level !== 'silent',
+ env: {
+ npm_old_version: current,
+ npm_new_version: newV,
+ },
+ })
+ }
return newV
}
diff --git a/node_modules/libnpmversion/package.json b/node_modules/libnpmversion/package.json
index 8930d69a4..3d15bbc2f 100644
--- a/node_modules/libnpmversion/package.json
+++ b/node_modules/libnpmversion/package.json
@@ -1,6 +1,6 @@
{
"name": "libnpmversion",
- "version": "1.0.10",
+ "version": "1.0.11",
"main": "lib/index.js",
"files": [
"lib/*.js"
@@ -29,7 +29,7 @@
},
"dependencies": {
"@npmcli/git": "^2.0.6",
- "@npmcli/run-script": "^1.8.2",
+ "@npmcli/run-script": "^1.8.3",
"read-package-json-fast": "^2.0.1",
"semver": "^7.3.4",
"stringify-package": "^1.0.1"