You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
573 B
30 lines
573 B
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.stdout.filter(Boolean)
|
|
}
|
|
}
|
|
|
|
module.exports = exports = ExecutionResult
|