release-it
Advanced tools
Comparing version 14.12.5 to 14.13.0
@@ -29,2 +29,3 @@ { | ||
"ignoreVersion": false, | ||
"allowSameVersion": false, | ||
"skipChecks": false, | ||
@@ -31,0 +32,0 @@ "timeout": 10 |
const { EOL } = require('os'); | ||
const _ = require('lodash'); | ||
const execa = require('execa'); | ||
const matcher = require('wildcard-match'); | ||
const { format, e } = require('../../util'); | ||
@@ -97,3 +98,3 @@ const GitBase = require('../GitBase'); | ||
const requiredBranches = _.castArray(this.options.requireBranch); | ||
return requiredBranches.includes(branch); | ||
return matcher(requiredBranches)(branch); | ||
} | ||
@@ -100,0 +101,0 @@ |
@@ -85,3 +85,4 @@ const path = require('path'); | ||
const task = () => this.exec(`npm version ${version} --no-git-tag-version`); | ||
const allowSameVersion = this.options.allowSameVersion ? ' --allow-same-version' : ''; | ||
const task = () => this.exec(`npm version ${version} --no-git-tag-version${allowSameVersion}`); | ||
return this.spinner.show({ task, label: 'npm version' }); | ||
@@ -88,0 +89,0 @@ } |
{ | ||
"name": "release-it", | ||
"version": "14.12.5", | ||
"version": "14.13.0", | ||
"description": "Generic CLI tool to automate versioning and package publishing related tasks.", | ||
@@ -84,2 +84,3 @@ "keywords": [ | ||
"uuid": "8.3.2", | ||
"wildcard-match": "5.1.2", | ||
"yaml": "1.10.2", | ||
@@ -86,0 +87,0 @@ "yargs-parser": "20.2.9" |
@@ -27,2 +27,15 @@ const test = require('ava'); | ||
test.serial('should not throw if required branch matches', async t => { | ||
const options = { git: { requireBranch: 'ma?*' } }; | ||
const gitClient = factory(Git, { options }); | ||
await t.notThrowsAsync(gitClient.init()); | ||
}); | ||
test.serial('should not throw if one of required branch matches', async t => { | ||
const options = { git: { requireBranch: ['release/*', 'hotfix/*'] } }; | ||
const gitClient = factory(Git, { options }); | ||
sh.exec('git checkout -b release/v1'); | ||
await t.notThrowsAsync(gitClient.init()); | ||
}); | ||
test.serial('should throw if there is no remote Git url', async t => { | ||
@@ -29,0 +42,0 @@ const gitClient = factory(Git, { options: { git } }); |
@@ -352,1 +352,10 @@ const path = require('path'); | ||
}); | ||
test('should add allow-same-version argument', async t => { | ||
const options = { npm: { skipChecks: true, allowSameVersion: true } }; | ||
const npmClient = factory(npm, { options }); | ||
const exec = sinon.stub(npmClient.shell, 'exec').resolves(); | ||
await runTasks(npmClient); | ||
const version = exec.args.filter(arg => arg[0].startsWith('npm version')); | ||
t.regex(version[0][0], / --allow-same-version/); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
211182
5041
29
+ Addedwildcard-match@5.1.2
+ Added@babel/code-frame@7.24.7(transitive)
+ Added@babel/helper-validator-identifier@7.24.7(transitive)
+ Added@babel/highlight@7.24.7(transitive)
+ Addedwildcard-match@5.1.2(transitive)
- Removed@babel/code-frame@7.25.7(transitive)
- Removed@babel/helper-validator-identifier@7.25.7(transitive)
- Removed@babel/highlight@7.25.7(transitive)