21 lines
544 B
TypeScript
21 lines
544 B
TypeScript
import { execFileSync } from "node:child_process";
|
|
|
|
const binary = process.env.SF_SMOKE_BINARY || "npx";
|
|
const args = process.env.SF_SMOKE_BINARY ? ["--help"] : ["sf-run", "--help"];
|
|
|
|
const output = execFileSync(binary, args, {
|
|
encoding: "utf8",
|
|
timeout: 30_000,
|
|
});
|
|
|
|
const lower = output.toLowerCase();
|
|
|
|
if (!lower.includes("sf")) {
|
|
console.error(`Help output does not contain "sf": "${output}"`);
|
|
process.exit(1);
|
|
}
|
|
|
|
if (!lower.includes("usage")) {
|
|
console.error(`Help output does not contain "usage": "${output}"`);
|
|
process.exit(1);
|
|
}
|