MCPcopy
hub / github.com/SamVerschueren/listr / run

Method run

index.js:85–116  ·  view source on GitHub ↗
(context)

Source from the content-addressed store, hash-verified

83 }
84
85 run(context) {
86 this.render();
87
88 context = context || Object.create(null);
89
90 const errors = [];
91
92 this._checkAll(context);
93
94 const tasks = pMap(this._tasks, task => {
95 this._checkAll(context);
96 return runTask(task, context, errors);
97 }, {concurrency: this.concurrency});
98
99 return tasks
100 .then(() => {
101 if (errors.length > 0) {
102 const err = new ListrError('Something went wrong');
103 err.errors = errors;
104 throw err;
105 }
106
107 this._renderer.end();
108
109 return context;
110 })
111 .catch(error => {
112 error.context = context;
113 this._renderer.end(error);
114 throw error;
115 });
116 }
117}
118
119module.exports = Listr;

Callers 13

runTaskFunction · 0.45
example.jsFile · 0.45
output.jsFile · 0.45
enabled.jsFile · 0.45
task-wrapper.jsFile · 0.45
skip.jsFile · 0.45
exit-on-error.jsFile · 0.45
test.jsFile · 0.45
concurrent.jsFile · 0.45
tty.jsFile · 0.45
renderer.jsFile · 0.45
subtask.jsFile · 0.45

Calls 4

renderMethod · 0.95
_checkAllMethod · 0.95
runTaskFunction · 0.85
endMethod · 0.45

Tested by

no test coverage detected