|
|
|
@ -21112,8 +21112,8 @@ var __publicField2 = (obj, key, value) => {
|
|
|
|
|
return value;
|
|
|
|
|
};
|
|
|
|
|
var Shell = class {
|
|
|
|
|
process;
|
|
|
|
|
constructor(env_passthrough = ["PATH"]) {
|
|
|
|
|
__publicField(this, "process");
|
|
|
|
|
const env2 = { PS1: "" };
|
|
|
|
|
env_passthrough.forEach((key) => {
|
|
|
|
|
env2[key] = process.env[key];
|
|
|
|
@ -21150,6 +21150,21 @@ var trimFinalNewline = (input) => {
|
|
|
|
|
return input;
|
|
|
|
|
};
|
|
|
|
|
var Command = class {
|
|
|
|
|
shell;
|
|
|
|
|
cmd;
|
|
|
|
|
cwd;
|
|
|
|
|
interactive;
|
|
|
|
|
exec;
|
|
|
|
|
runningState;
|
|
|
|
|
pipe_logs;
|
|
|
|
|
exit_expected;
|
|
|
|
|
retCode;
|
|
|
|
|
promiseResolve;
|
|
|
|
|
promiseReject;
|
|
|
|
|
promise;
|
|
|
|
|
timer;
|
|
|
|
|
stdout;
|
|
|
|
|
stderr;
|
|
|
|
|
constructor({
|
|
|
|
|
cwd,
|
|
|
|
|
shell,
|
|
|
|
@ -21158,22 +21173,23 @@ var Command = class {
|
|
|
|
|
pipe_logs = false,
|
|
|
|
|
exit_expected = false
|
|
|
|
|
}) {
|
|
|
|
|
__publicField(this, "shell");
|
|
|
|
|
__publicField(this, "cmd");
|
|
|
|
|
__publicField(this, "cwd");
|
|
|
|
|
__publicField(this, "interactive");
|
|
|
|
|
__publicField(this, "exec");
|
|
|
|
|
__publicField(this, "runningState");
|
|
|
|
|
__publicField(this, "pipe_logs");
|
|
|
|
|
__publicField(this, "exit_expected");
|
|
|
|
|
__publicField(this, "retCode");
|
|
|
|
|
__publicField(this, "promiseResolve");
|
|
|
|
|
__publicField(this, "promiseReject");
|
|
|
|
|
__publicField(this, "promise");
|
|
|
|
|
__publicField(this, "timer");
|
|
|
|
|
__publicField(this, "stdout");
|
|
|
|
|
__publicField(this, "stderr");
|
|
|
|
|
__publicField(this, "handleStdoutData", (data) => {
|
|
|
|
|
this.shell = shell;
|
|
|
|
|
this.cmd = cmd;
|
|
|
|
|
this.cwd = cwd;
|
|
|
|
|
this.interactive = interactive;
|
|
|
|
|
this.exit_expected = exit_expected;
|
|
|
|
|
this.exec = `cd "${cwd}" &&
|
|
|
|
|
${this.cmd};echo __END_OF_COMMAND_[$?]__
|
|
|
|
|
`;
|
|
|
|
|
this.shell.process.on("exit", this.finish);
|
|
|
|
|
this.shell.getStdout().on("data", this.handleStdoutData);
|
|
|
|
|
this.shell.getStderr().on("data", this.handleStderrData);
|
|
|
|
|
this.runningState = 0;
|
|
|
|
|
this.pipe_logs = pipe_logs;
|
|
|
|
|
this.stdout = "";
|
|
|
|
|
this.stderr = "";
|
|
|
|
|
}
|
|
|
|
|
handleStdoutData = (data) => {
|
|
|
|
|
const lines = trimFinalNewline(data).split(/\r?\n/);
|
|
|
|
|
for (let i = 0; i < lines.length; i++) {
|
|
|
|
|
const line = lines[i];
|
|
|
|
@ -21191,17 +21207,17 @@ var Command = class {
|
|
|
|
|
this.interactive(line, this.handleStdinData);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
__publicField(this, "handleStderrData", (data) => {
|
|
|
|
|
};
|
|
|
|
|
handleStderrData = (data) => {
|
|
|
|
|
if (this.pipe_logs)
|
|
|
|
|
process.stderr.write(data);
|
|
|
|
|
this.stderr += data;
|
|
|
|
|
});
|
|
|
|
|
__publicField(this, "handleStdinData", (data) => {
|
|
|
|
|
};
|
|
|
|
|
handleStdinData = (data) => {
|
|
|
|
|
this.shell.getStdin().write(`${data}
|
|
|
|
|
`);
|
|
|
|
|
});
|
|
|
|
|
__publicField(this, "run", () => {
|
|
|
|
|
};
|
|
|
|
|
run = () => {
|
|
|
|
|
let promiseResolve, promiseReject;
|
|
|
|
|
const promise = new Promise((resolve, reject) => {
|
|
|
|
|
promiseResolve = resolve;
|
|
|
|
@ -21243,8 +21259,8 @@ ${this.stderr}
|
|
|
|
|
this.shell.exit();
|
|
|
|
|
throw e;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
__publicField(this, "finish", () => {
|
|
|
|
|
};
|
|
|
|
|
finish = () => {
|
|
|
|
|
this.runningState = 2;
|
|
|
|
|
clearTimeout(this.timer);
|
|
|
|
|
this.shell.getStdout().removeListener("data", this.handleStdoutData);
|
|
|
|
@ -21273,24 +21289,8 @@ ${this.stderr}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return this.promiseResolve(obj);
|
|
|
|
|
});
|
|
|
|
|
__publicField(this, "log", Shell.logger);
|
|
|
|
|
this.shell = shell;
|
|
|
|
|
this.cmd = cmd;
|
|
|
|
|
this.cwd = cwd;
|
|
|
|
|
this.interactive = interactive;
|
|
|
|
|
this.exit_expected = exit_expected;
|
|
|
|
|
this.exec = `cd "${cwd}" &&
|
|
|
|
|
${this.cmd};echo __END_OF_COMMAND_[$?]__
|
|
|
|
|
`;
|
|
|
|
|
this.shell.process.on("exit", this.finish);
|
|
|
|
|
this.shell.getStdout().on("data", this.handleStdoutData);
|
|
|
|
|
this.shell.getStderr().on("data", this.handleStderrData);
|
|
|
|
|
this.runningState = 0;
|
|
|
|
|
this.pipe_logs = pipe_logs;
|
|
|
|
|
this.stdout = "";
|
|
|
|
|
this.stderr = "";
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
log = Shell.logger;
|
|
|
|
|
};
|
|
|
|
|
async function IfStatement(chunk, context2) {
|
|
|
|
|
const { interps, last_cmd } = context2;
|
|
|
|
@ -22060,7 +22060,7 @@ var src_default = shellac;
|
|
|
|
|
// src/index.ts
|
|
|
|
|
var import_undici = __toESM(require_undici());
|
|
|
|
|
var import_process = require("process");
|
|
|
|
|
var import_node_path = __toESM(require("path"));
|
|
|
|
|
var import_node_path = __toESM(require("node:path"));
|
|
|
|
|
try {
|
|
|
|
|
const apiToken = (0, import_core.getInput)("apiToken", { required: true });
|
|
|
|
|
const accountId = (0, import_core.getInput)("accountId", { required: true });
|
|
|
|
|