Skip to content

Commit

Permalink
- Improve exec method.
Browse files Browse the repository at this point in the history
  • Loading branch information
miroslavpojer committed May 16, 2024
1 parent c877138 commit 4b49ae3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26839,20 +26839,19 @@ async function run() {

// Running the Python script with an input
exec(command, (error, stdout, stderr) => {
core.info(`Python script output: ${stdout}`);

if (error) {
core.error(`Error executing script: ${error.message}`)
core.error(`Error code: ${error.code}`);
core.error(`Error signal: ${error.signal}`);
core.error(`Error stack: ${error.stack}`);

core.setFailed(`Execution error: ${error}`);
return;
core.setFailed(`Execution error.`);
}
if (stderr) {
core.setFailed(`Execution stderr: ${stderr}`);
return;
}
console.log(`Python script output: ${stdout}`);

core.setOutput("documentation-path", stdout.trim());
});
Expand Down
7 changes: 3 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,19 @@ async function run() {

// Running the Python script with an input
exec(command, (error, stdout, stderr) => {
core.info(`Python script output: ${stdout}`);

if (error) {
core.error(`Error executing script: ${error.message}`)
core.error(`Error code: ${error.code}`);
core.error(`Error signal: ${error.signal}`);
core.error(`Error stack: ${error.stack}`);

core.setFailed(`Execution error: ${error}`);
return;
core.setFailed(`Execution error.`);
}
if (stderr) {
core.setFailed(`Execution stderr: ${stderr}`);
return;
}
console.log(`Python script output: ${stdout}`);

core.setOutput("documentation-path", stdout.trim());
});
Expand Down

0 comments on commit 4b49ae3

Please sign in to comment.