Skip to content

Commit

Permalink
fix: dist tag variable name
Browse files Browse the repository at this point in the history
Co-authored-by: Jordan Harband <ljharb@gmail.com>
  • Loading branch information
reggi and ljharb authored Dec 2, 2024
1 parent 5eefb5b commit 45b82a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/commands/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ class Publish extends BaseCommand {

const resolved = npa.resolve(manifest.name, manifest.version)

const latestDistTag = await this.#latestPublishedVersion(resolved)
const latestTagIsGreater = latestDistTag ? semver.gte(latestDistTag, manifest.version) : false
const latestVersion = await this.#latestPublishedVersion(resolved)
const latestTagIsGreater = !!latestVersion && semver.gte(latestVersion, manifest.version)

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

0 comments on commit 45b82a9

Please sign in to comment.