function apply
apply(): Promise<string[]>

Downloads the release archive, verifies it against the release's checksums.txt, and replaces the running binary (and its esbuild sidecar, when the install has one).

Nothing on disk is touched until the bytes are verified, and the replace itself is one atomic rename per file, so an interrupted upgrade leaves a working binary either way.

import * as Install from './install.ts';
import type { InstallPlan } from './install.ts';

// Defined, not invoked: downloads a release and rewrites files on disk.
async function upgradeBinary(plan: InstallPlan) {
  return await Install.apply(plan); // ['/opt/qunitx/qunitx', '/opt/qunitx/esbuild']
}

Parameters

optional
deps: InstallDeps

Return Type

Promise<string[]>

the absolute paths it replaced, binary first.

Usage

import { apply } from "lib/commands/upgrade/install.ts";