Skip to content

Commit

Permalink
fix(internals/scripts): Trim Newlines from SemVer
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianWendelborn committed Apr 20, 2024
1 parent 3fb2385 commit dc30d77
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internals/scripts/source/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const packageJsonSchema = z.object({ name: z.string(), version: z.string() })

const getRemoteVersion = async (name: string): Promise<string | null> => {
try {
return await $`npm view ${name} version`.text()
return (await $`npm view ${name} version`.text()).trim()
} catch {
return null
}
Expand All @@ -27,6 +27,7 @@ for (const path of packagesToConsider) {

const shouldPublish =
remoteVersion === null || semver.order(version, remoteVersion) === 1

if (!shouldPublish) {
console.info(`${path}: already up-to-date, skipping`)
continue
Expand Down

0 comments on commit dc30d77

Please sign in to comment.