Skip to content

Commit

Permalink
[cli] Coerce @sanity/core version string before performing satisfacti…
Browse files Browse the repository at this point in the history
…on check (#804)
  • Loading branch information
Thomas Drevon committed May 14, 2018
1 parent d98b3bf commit aa5eef2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/@sanity/cli/src/util/mergeCommands.js
Expand Up @@ -13,7 +13,10 @@ export default (baseCommands, corePath, options = {}) => {
const {cwd, workDir} = options
const core = dynamicRequire(corePath)

if (core.requiredCliVersionRange && !semver.satisfies(version, core.requiredCliVersionRange)) {
if (
core.requiredCliVersionRange &&
!semver.satisfies(semver.coerce(version), core.requiredCliVersionRange)
) {
const upgradeCmd = chalk.yellow(getUpgradeCommand({cwd, workDir}))
/* eslint-disable no-console, no-process-exit */
console.error(
Expand Down

0 comments on commit aa5eef2

Please sign in to comment.