Skip to content

Commit 0f7f1af

Browse files
reggiljharb
andcommitted
fix: dist tag variable name
Co-authored-by: Jordan Harband <[email protected]>
1 parent 93fcf15 commit 0f7f1af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/commands/publish.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ class Publish extends BaseCommand {
131131

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

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

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

0 commit comments

Comments
 (0)