@enspirit/emb
Version:
A replacement for our Makefile-for-monorepos
23 lines (22 loc) • 806 B
JavaScript
import { Listr } from 'listr2';
import { FlavoredCommand, getContext } from '../index.js';
import { ComposeStopOperation } from '../../docker/index.js';
export default class StopCommand extends FlavoredCommand {
static description = 'Stop the whole project.';
static enableJsonFlag = true;
static examples = ['<%= config.bin %> <%= command.id %>'];
static flags = {};
async run() {
const { monorepo } = getContext();
const runner = new Listr([
{
rendererOptions: { persistentOutput: true },
async task(ctx, task) {
return monorepo.run(new ComposeStopOperation(task.stdout()), {});
},
title: 'Stopping project',
},
]);
await runner.run();
}
}