From 3b45962253a0b69184de5cd339b134e47b551286 Mon Sep 17 00:00:00 2001 From: Ashton Eby Date: Tue, 29 Oct 2024 13:55:54 -0700 Subject: [PATCH] prevent SEA installations from attempting an update check --- sea/README.md | 2 +- src/config/setup-container.mjs | 2 ++ src/lib/middleware.mjs | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/sea/README.md b/sea/README.md index 0348a1dc..ffa0b98d 100644 --- a/sea/README.md +++ b/sea/README.md @@ -18,4 +18,4 @@ The process generally looks like this: _All 3 versions should be runnable and behave the same, with these exceptions:_ -- Currently, no exceptions. +- SEA installations do not check for updates, present a nag, or have an upgrade path. diff --git a/src/config/setup-container.mjs b/src/config/setup-container.mjs index df64ec38..d06ea2b6 100644 --- a/src/config/setup-container.mjs +++ b/src/config/setup-container.mjs @@ -8,6 +8,7 @@ import { confirm } from "@inquirer/prompts"; import * as awilix from "awilix"; import { Lifetime } from "awilix"; import open from "open"; +import updateNotifier from "update-notifier"; import { parseYargs } from "../cli.mjs"; import { performQuery } from "../commands/eval.mjs"; @@ -60,6 +61,7 @@ export const injectables = { // third-party libraries confirm: awilix.asValue(confirm), open: awilix.asValue(open), + updateNotifier: awilix.asValue(updateNotifier), // generic lib (homemade utilities) parseYargs: awilix.asValue(parseYargs), diff --git a/src/lib/middleware.mjs b/src/lib/middleware.mjs index b1cf7f9d..3a72ac93 100644 --- a/src/lib/middleware.mjs +++ b/src/lib/middleware.mjs @@ -2,6 +2,7 @@ import { readFileSync } from "node:fs"; import path from "node:path"; +import { isSea } from "node:sea"; import { fileURLToPath } from "node:url"; import { container } from "../cli.mjs"; @@ -22,6 +23,9 @@ export function fixPaths(argv) { } export function checkForUpdates(argv) { + // TODO: figure out upgrade path for SEA installations + if (isSea()) return argv; + const __filename = fileURLToPath(import.meta.url); let __dirname = path.dirname(__filename); if (__dirname.split(path.sep).pop() === "dist") {