From dc30d776382c00dd36f40dc66576a03f0bb98c88 Mon Sep 17 00:00:00 2001 From: Florian Wendelborn <1133858+FlorianWendelborn@users.noreply.github.com> Date: Sat, 20 Apr 2024 03:04:15 +0200 Subject: [PATCH] fix(internals/scripts): Trim Newlines from SemVer --- internals/scripts/source/publish.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internals/scripts/source/publish.ts b/internals/scripts/source/publish.ts index f4ef1b2..2c73c51 100644 --- a/internals/scripts/source/publish.ts +++ b/internals/scripts/source/publish.ts @@ -7,7 +7,7 @@ const packageJsonSchema = z.object({ name: z.string(), version: z.string() }) const getRemoteVersion = async (name: string): Promise => { try { - return await $`npm view ${name} version`.text() + return (await $`npm view ${name} version`.text()).trim() } catch { return null } @@ -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