interface InstallDeps

The seams apply reaches the world through. All three default to the real thing.

import type { InstallDeps } from './install.ts';

const deps: InstallDeps = { access: () => Promise.reject(new Error('EACCES')) };
deps.access !== undefined; // true — a read-only install directory, with no chmod in sight

Properties

optional
fetch: fetch

Fetches the checksum file and the archive.

optional
extract: (
archivePath: string,
destination: string
) => Promise<void>

Unpacks the archive into a directory. Defaults to extract.

optional
access: (directory: string) => Promise<void>

Rejects when the install directory cannot be written. Defaults to fs.access(dir, W_OK).

Usage

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