nx/packages/devkit/src/generators/run-tasks-in-serial.ts
2024-05-01 12:12:32 -04:00

17 lines
320 B
TypeScript

import type { GeneratorCallback } from 'nx/src/devkit-exports';
/**
* Run tasks in serial
*
* @param tasks The tasks to run in serial.
*/
export function runTasksInSerial(
...tasks: GeneratorCallback[]
): GeneratorCallback {
return async () => {
for (const task of tasks) {
await task();
}
};
}