Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEA updater #412

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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