From ff2d7c02cc0971e10e66c96faa18dff99ecd3e0a Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Fri, 24 Feb 2023 11:26:24 -0800 Subject: [PATCH] fix: better macOS asset error msg (#127) Closes #125 --- src/updates.js | 2 +- test/update.test.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/updates.js b/src/updates.js index 05b3e651..445b7b68 100644 --- a/src/updates.js +++ b/src/updates.js @@ -88,7 +88,7 @@ class Updates { if (!latest) { const message = platform.includes(PLATFORM.DARWIN) - ? "No updates found (needs asset matching *{mac,darwin,osx}*.zip in public repository)" + ? "No updates found (needs asset matching *(mac|darwin|osx).*(-arm).*.zip in public repository)" : "No updates found (needs asset containing win32-{x64,ia32,arm64} or .exe in public repository)"; notFound(res, message); } else if (semver.lte(latest.version, version)) { diff --git a/test/update.test.js b/test/update.test.js index 358513cf..29e01d2d 100644 --- a/test/update.test.js +++ b/test/update.test.js @@ -303,7 +303,7 @@ test("Updates", async (t) => { let body = await res.text(); t.equal( body, - "No updates found (needs asset matching *{mac,darwin,osx}*.zip in public repository)" + "No updates found (needs asset matching *(mac|darwin|osx).*(-arm).*.zip in public repository)" ); res = await fetch(`${address}/owner/repo-win32-zip/darwin/0.0.0`); @@ -311,7 +311,7 @@ test("Updates", async (t) => { body = await res.text(); t.equal( body, - "No updates found (needs asset matching *{mac,darwin,osx}*.zip in public repository)" + "No updates found (needs asset matching *(mac|darwin|osx).*(-arm).*.zip in public repository)" ); }); });