Skip to content

Commit

Permalink
prevent SEA installations from attempting an update check
Browse files Browse the repository at this point in the history
  • Loading branch information
echo-bravo-yahoo committed Nov 13, 2024
1 parent b5f4e99 commit 3b45962
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sea/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 2 additions & 0 deletions src/config/setup-container.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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),
Expand Down
4 changes: 4 additions & 0 deletions src/lib/middleware.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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") {
Expand Down

0 comments on commit 3b45962

Please sign in to comment.