@enspirit/emb
Version:
A replacement for our Makefile-for-monorepos
31 lines (30 loc) • 1.04 kB
JavaScript
import { Args } from '@oclif/core';
import { BaseCommand, getContext } from '../index.js';
import { ComposeStartOperation } from '../../docker/index.js';
export default class StartCommand extends BaseCommand {
static description = 'Starts the whole project.';
static enableJsonFlag = true;
static examples = ['<%= config.bin %> <%= command.id %>'];
static flags = {};
static args = {
component: Args.string({
name: 'component',
description: 'The component(s) to start',
}),
};
static strict = false;
async run() {
const { argv } = await this.parse(StartCommand);
const { monorepo } = getContext();
let components;
if (argv.length > 0) {
components =
argv.length > 0
? argv.map((name) => monorepo.component(name))
: undefined;
}
await monorepo.run(new ComposeStartOperation(), {
services: components?.map((c) => c.name),
});
}
}