import * as step from "../../src/index" async function run() { const nodeInstallCachedFilePath = await step.tool.install("node", "v20.12.2", "tar.gz") step.info("node install cached file path: " + nodeInstallCachedFilePath) const shellName = "ls" const args = ["-l", "-a", nodeInstallCachedFilePath] step.infoCyan(`exec command: ${shellName} ${args.join(" ")}`) await step.exec.call(shellName, args, { listener: { stdoutLine: (line: string) => { step.info(line) }, stderrLine: (line: string) => { step.error(line) } } }) // Add to PATH variable, effective in current and subsequent steps step.info(`before addPath PATH=${process.env["PATH"]}`) step.addPath(`${nodeInstallCachedFilePath}/bin`) step.info(`after addPath PATH=${process.env["PATH"]}`) step.infoCyan(`exec command: which node`) await step.exec.call(`which`, ['node'], { listener: { stdoutLine: (line: string) => { step.info(line) }, stderrLine: (line: string) => { step.error(line) } } }) } run()