Skip to content

Commit

Permalink
chore: restrict get-next-version to packages and cli dirs (#15099)
Browse files Browse the repository at this point in the history
  • Loading branch information
flotwig authored Feb 15, 2021
1 parent 1d878d2 commit 5696bee
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions scripts/get-next-version.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
/* eslint-disable no-console */

const semver = require('semver')
const Bluebird = require('bluebird')
const bumpCb = require('conventional-recommended-bump')
const currentVersion = require('../package.json').version

const bump = Bluebird.promisify(bumpCb)
const paths = ['packages', 'cli']

let nextVersion

const getNextVersionForPath = async (path) => {
const { releaseType } = await bump({ preset: 'angular', path })

const fail = (...reason) => {
console.error(...reason)
process.exit(1)
return semver.inc(currentVersion, releaseType || 'patch')
}

const bump = require('conventional-recommended-bump')
const currentVersion = require('../package.json').version
Bluebird.mapSeries(paths, async (path) => {
const pathNextVersion = await getNextVersionForPath(path)

bump({ preset: 'angular' }, (err, { releaseType }) => {
if (err) {
return fail('Error getting next version', err)
if (!nextVersion || semver.gt(pathNextVersion, nextVersion)) {
nextVersion = pathNextVersion
}
})
.then(() => {
if (!nextVersion) {
throw new Error('Unable to determine next version.')
}

const nextVersion = semver.inc(currentVersion, releaseType || 'patch')

if (process.argv.includes('--npm')) {
const cmd = `npm --no-git-tag-version version ${nextVersion}`
Expand Down

4 comments on commit 5696bee

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 5696bee Feb 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.5.0/circle-develop-5696bee2adc12c9ad08250d4dc369fdeaaf03d7d/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 5696bee Feb 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 ia32 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.5.0/appveyor-develop-5696bee2adc12c9ad08250d4dc369fdeaaf03d7d/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 5696bee Feb 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.5.0/appveyor-develop-5696bee2adc12c9ad08250d4dc369fdeaaf03d7d/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 5696bee Feb 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.5.0/circle-develop-5696bee2adc12c9ad08250d4dc369fdeaaf03d7d/cypress.tgz

Please sign in to comment.