MCPcopy
hub / github.com/shower/shower / runTask

Function runTask

packages/cli/core/lib/task.js:3–12  ·  view source on GitHub ↗
(title, fn)

Source from the content-addressed store, hash-verified

1import { styleText } from 'node:util';
2
3export async function runTask(title, fn) {
4 process.stdout.write(styleText('yellow', `◌ ${title}…\n`));
5 try {
6 await fn();
7 process.stdout.write(`\x1b[1A\x1b[2K${styleText('green', `✔ ${title}`)}\n`);
8 } catch (error) {
9 process.stdout.write(`\x1b[1A\x1b[2K${styleText('red', `✖ ${title}`)}\n`);
10 throw error;
11 }
12}

Callers 3

handlerFunction · 0.90
handlerFunction · 0.90
handlerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected