Skip to content

Commit

Permalink
More logging
Browse files Browse the repository at this point in the history
  • Loading branch information
d-co-white committed Jun 27, 2024
1 parent 02d6663 commit 52c0a4a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/hawk_process.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const {spawn} = require("child_process");
const core = require('@actions/core');

module.exports.spawnHawk = function spawnHawk(command, args) {
const child = spawn(command, args)
Expand All @@ -22,15 +23,18 @@ module.exports.spawnHawk = function spawnHawk(command, args) {

const promise = new Promise((resolve, reject) => {
child.on('error',(err) => {
core.info("The child process errored")
reject(err);
});

child.on('close', code => {
core.info("The child process closed")
if (code === 0) {
response.stdout = stdout;
response.code = code;
resolve(response);
} else {
core.info("The child process non zeroed")
const err = new Error(`child exited with code ${code}`);
// err.code = code;
// err.stderr = stderr;
Expand Down

0 comments on commit 52c0a4a

Please sign in to comment.