1
0
Fork 0
mirror of https://github.com/dawidd6/action-ansible-playbook.git synced 2025-04-20 14:53:34 +00:00

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"
let output = ''
const execOptions = {}
execOptions.listeners = {
stdout: function(data) {
output += data.toString()
},
stderr: function(data) {
output += data.toString()
let output = ""
await exec.exec(cmd.join(' '), null, {
listeners: {
stdout: function(data) {
output += data.toString()
},
stderr: function(data) {
output += data.toString()
}
}
}
await exec.exec(cmd.join(' '), null, execOptions)
core.setOutput('output', output)
})
core.setOutput("output", output)
} catch (error) {
core.setFailed(error.message)
}