Embed execOptions as parameter to exec

This commit is contained in:
Brooks Swinnerton 2021-07-31 08:46:43 -04:00
parent bf8069946f
commit ccd1cd7184
No known key found for this signature in database
GPG Key ID: 72743B7DE552E25A

23
main.js
View File

@ -81,19 +81,18 @@ async function main() {
process.env.ANSIBLE_FORCE_COLOR = "True" process.env.ANSIBLE_FORCE_COLOR = "True"
let output = '' let output = ""
const execOptions = {} await exec.exec(cmd.join(' '), null, {
execOptions.listeners = { listeners: {
stdout: function(data) { stdout: function(data) {
output += data.toString() output += data.toString()
}, },
stderr: function(data) { stderr: function(data) {
output += data.toString() output += data.toString()
}
} }
} })
core.setOutput("output", output)
await exec.exec(cmd.join(' '), null, execOptions)
core.setOutput('output', output)
} catch (error) { } catch (error) {
core.setFailed(error.message) core.setFailed(error.message)
} }