fix(update): honor update.channel for update.run

This commit is contained in:
Peter Steinberger
2026-02-03 17:57:44 -08:00
parent 61a7fc5e0e
commit bbe9cb3022
5 changed files with 98 additions and 2 deletions

View File

@@ -3,7 +3,14 @@ import os from "node:os";
import path from "node:path";
import { type CommandOptions, runCommandWithTimeout } from "../process/exec.js";
import { trimLogTail } from "./restart-sentinel.js";
import { DEV_BRANCH, isBetaTag, isStableTag, type UpdateChannel } from "./update-channels.js";
import {
channelToNpmTag,
DEFAULT_PACKAGE_CHANNEL,
DEV_BRANCH,
isBetaTag,
isStableTag,
type UpdateChannel,
} from "./update-channels.js";
import { compareSemverStrings } from "./update-check.js";
import {
cleanupGlobalRenameDirs,
@@ -800,7 +807,9 @@ export async function runGatewayUpdate(opts: UpdateRunnerOptions = {}): Promise<
globalRoot: path.dirname(pkgRoot),
packageName,
});
const spec = `${packageName}@${normalizeTag(opts.tag)}`;
const channel = opts.channel ?? DEFAULT_PACKAGE_CHANNEL;
const tag = normalizeTag(opts.tag ?? channelToNpmTag(channel));
const spec = `${packageName}@${tag}`;
const updateStep = await runStep({
runCommand,
name: "global update",