From 0957b43d6a76ad6d697cbe0d8e5aff6b39653f6a Mon Sep 17 00:00:00 2001 From: Pete Cook Date: Sun, 26 Jul 2020 21:00:45 +0100 Subject: [PATCH] Remove requirement for --latest-version to be valid semver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I’m not sure why it needed to be semver valid in the first place… Fixes https://github.com/CookPete/auto-changelog/issues/178 --- src/run.js | 4 ---- test/run.js | 6 ------ 2 files changed, 10 deletions(-) diff --git a/src/run.js b/src/run.js index 9c799eb6..27008a46 100644 --- a/src/run.js +++ b/src/run.js @@ -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') @@ -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) { diff --git a/test/run.js b/test/run.js index 4344e300..aed0457b 100644 --- a/test/run.js +++ b/test/run.js @@ -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()) - }) })