Skip to content

Commit

Permalink
fix: tag termanology
Browse files Browse the repository at this point in the history
  • Loading branch information
reggi committed Dec 5, 2024
1 parent 0f4be49 commit 03ec495
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/commands/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ class Publish extends BaseCommand {
const registry = npmFetch.pickRegistry(resolved, opts)

const latestVersion = await this.#latestPublishedVersion(resolved, registry)
const latestTagIsGreater = !!latestVersion && semver.gte(latestVersion, manifest.version)
const latestSemverIsGreater = !!latestVersion && semver.gte(latestVersion, manifest.version)

if (latestTagIsGreater && isDefaultTag) {
throw new Error('Cannot publish a lower version without an explicit dist tag.')
if (latestSemverIsGreater && isDefaultTag) {
throw new Error('Cannot publish a lower version without an explicit tag.')
}

// make sure tag is valid, this will throw if invalid
Expand Down

0 comments on commit 03ec495

Please sign in to comment.