Skip to content

Commit

Permalink
Remove requirement for --latest-version to be valid semver
Browse files Browse the repository at this point in the history
I’m not sure why it needed to be semver valid in the first place…
Fixes cookpete#178
  • Loading branch information
cookpete committed Jul 27, 2020
1 parent 1fc916c commit 0957b43
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
4 changes: 0 additions & 4 deletions src/run.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const { Command } = require('commander')
const semver = require('semver')
const { version } = require('../package.json')
const { fetchRemote } = require('./remote')
const { fetchTags } = require('./tags')
Expand Down Expand Up @@ -76,9 +75,6 @@ const getOptions = async argv => {

const getLatestVersion = async options => {
if (options.latestVersion) {
if (!semver.valid(options.latestVersion)) {
throw new Error('--latest-version must be a valid semver version')
}
return options.latestVersion
}
if (options.package) {
Expand Down
6 changes: 0 additions & 6 deletions test/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,4 @@ describe('run', () => {
.then(() => done('Should throw an error'))
.catch(() => done())
})

it('throws an error when given an invalid latest version', done => {
run(['', '', '--latest-version', 'invalid'])
.then(() => done('Should throw an error'))
.catch(() => done())
})
})

0 comments on commit 0957b43

Please sign in to comment.