maestro/app/classes/logical/ExecutionResult.js

30 lines
573 B
JavaScript
Raw Normal View History

2020-02-21 06:36:55 +00:00
const { Injectable } = require('flitter-di')
class ExecutionResult extends Injectable {
stdout = []
stderr = []
exit_code = 0
out(data) {
this.stdout = this.stdout.concat(String(data).split('\n'))
}
error(data) {
this.stderr = this.stderr.concat(String(data).split('\n'))
}
exit(code) {
this.exit_code = Number(code)
}
get clean_out() {
return this.stdout.filter(Boolean)
}
get clean_err() {
return this.stderr.filter(Boolean)
2020-02-21 06:36:55 +00:00
}
}
module.exports = exports = ExecutionResult