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

11
main.js
View File

@ -81,9 +81,9 @@ 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()
}, },
@ -91,9 +91,8 @@ async function main() {
output += data.toString() output += data.toString()
} }
} }
})
await exec.exec(cmd.join(' '), null, execOptions) core.setOutput("output", output)
core.setOutput('output', output)
} catch (error) { } catch (error) {
core.setFailed(error.message) core.setFailed(error.message)
} }