IF Commons GitHub

physical/scripts

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-machine-probe-contract FR-004

The probe's two scripts, as text: a POSIX shell script for Linux and macOS and a PowerShell script for Windows. Each answers facts, version and one osquery SELECT and refuses everything else, reads only, listens on nothing and needs no root. They are shipped with the library as files and read here, so that what is installed on a machine is exactly what was reviewed.

import { probeScript } from "./scripts.ts";
(await probeScript("posix")).startsWith("#!/bin/sh"); // true

Source: commons/machine-probe/src/physical/scripts.ts

2 of 6 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

physical.ScriptKindtypeno test imports it
type ScriptKind = "posix" | "windows";

The system a script is for.

physical.probeScriptfunctionno test imports it
function probeScript(kind: ScriptKind): Promise<string>

The text of the probe script for a system.

physical.posixScriptPathfunctionno test imports it
function posixScriptPath(): string

The path of the POSIX script in the library, for a test or an installer that copies the file.

ScriptKindtypeno test imports it
type ScriptKind = "posix" | "windows";

The system a script is for.

probeScriptfunction
function probeScript(kind: ScriptKind): Promise<string>

The text of the probe script for a system.

Imported by 4 tests of the run (4 passed, 0 failed): the library's results

posixScriptPathfunction
function posixScriptPath(): string

The path of the POSIX script in the library, for a test or an installer that copies the file.

Imported by 5 tests of the run (5 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.