mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 12:19:20 +00:00
Adopt task.define (better task names)
This commit is contained in:
@@ -45,18 +45,16 @@ function _renderTime(time: number): string {
|
||||
return `${minutes} m and ${seconds} s`;
|
||||
}
|
||||
|
||||
const DONT_SHOW_PLEASE = `DONT_SHOW_PLEASE`;
|
||||
|
||||
async function _execute(task: Task): Promise<void> {
|
||||
const name = task.taskName || task.displayName || `<anonymous>`;
|
||||
if (name !== DONT_SHOW_PLEASE) {
|
||||
if (!task._tasks) {
|
||||
fancyLog('Starting', ansiColors.cyan(name), '...');
|
||||
}
|
||||
const startTime = process.hrtime();
|
||||
await _doExecute(task);
|
||||
const elapsedArr = process.hrtime(startTime);
|
||||
const elapsedNanoseconds = (elapsedArr[0] * 1e9 + elapsedArr[1]);
|
||||
if (name !== DONT_SHOW_PLEASE) {
|
||||
if (!task._tasks) {
|
||||
fancyLog(`Finished`, ansiColors.cyan(name), 'after', ansiColors.green(_renderTime(elapsedNanoseconds / 1e6)));
|
||||
}
|
||||
}
|
||||
@@ -125,7 +123,6 @@ export function define(name: string, task: Task): Task {
|
||||
}
|
||||
|
||||
lastTask.taskName = name;
|
||||
task.taskName = DONT_SHOW_PLEASE;
|
||||
task.displayName = name;
|
||||
return task;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user