From 1073a5d68df78e1d143ace2d7155b9ae0abed02e Mon Sep 17 00:00:00 2001 From: swee <meow@swee.codes> Date: Wed, 22 Jan 2025 17:24:21 -0800 Subject: [PATCH] Update index.js --- index.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/index.js b/index.js index b6021e8..84b4100 100644 --- a/index.js +++ b/index.js @@ -1,10 +1,12 @@ -const { exec } = require('node:child_process'); -var additional = process.env.INPUT_ADDITIONAL; -exec('apk add bash git ' + additional, (err, output) => { - if (err) { - console.log("Something went wrong..."); - console.log(output); - } else { - console.log("Successfully installed packages!"); - } -}) \ No newline at end of file +const { exec } = require('child_process'); +exec('apk add bash git ' + additional, (error, stdout, stderr) => { + if (error) { + console.error(`Error: ${error.message}`); + return; + } + if (stderr) { + console.error(`Stderr: ${stderr}`); + return; + } + console.log(`Stdout: ${stdout}`); +}); \ No newline at end of file