mirror of
https://github.com/pnpm/action-setup.git
synced 2026-03-01 07:51:02 +08:00
25 lines
604 B
TypeScript
25 lines
604 B
TypeScript
import { setFailed, startGroup, endGroup } from "@actions/core";
|
|
import { Inputs } from "../inputs";
|
|
import runSelfInstaller from "./run";
|
|
import { exec } from "child_process";
|
|
import { promisify } from "util";
|
|
|
|
const execAsync = promisify(exec);
|
|
|
|
export async function install(inputs: Inputs) {
|
|
try {
|
|
await execAsync("pnpm --version");
|
|
return;
|
|
} catch {}
|
|
|
|
startGroup("Running self-installer...");
|
|
const status = await runSelfInstaller(inputs);
|
|
endGroup();
|
|
|
|
if (status) {
|
|
setFailed(`Something went wrong, self-installer exits with code ${status}`);
|
|
}
|
|
}
|
|
|
|
export default install;
|