Skip to content

Commit 3824c59

Browse files
committed
chore: check version to determine whether to publish
1 parent c10abe0 commit 3824c59

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/publish.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ const resetdeps = () => npm('run', 'resetdeps')
88
const op = () => spawn('op', 'item', 'get', 'npm', '--otp', { out: true, ok: true })
99

1010
const getVersion = async (s) => {
11-
const mani = await pacote.manifest(s, { preferOnline: true })
12-
return mani.version
11+
const mani = await pacote.manifest(s, { preferOnline: true }).catch(() => null)
12+
return mani?.version
1313
}
1414
const getLatest = async (s) => {
1515
const pack = await pacote.packument(s, { preferOnline: true })
@@ -36,7 +36,7 @@ const needsPublish = async ({ private, name, version }, { force, getTag }) => {
3636
}
3737

3838
const tag = await getTag({ name, version })
39-
if (force || version !== await getVersion(`${name}@${tag}`)) {
39+
if (force || version !== await getVersion(`${name}@${version}`)) {
4040
return tag
4141
}
4242
}

0 commit comments

Comments
 (0)