Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* eslint-disable no-console, @typescript-eslint/no-misused-promises */
import path from 'path';
import chalk from 'chalk';
import yargs from 'yargs';
import Beemo, { StdioType } from '@beemo/core';
// @ts-ignore
import corePackage from '@beemo/core/package.json';
import parseSpecialArgv from './parseSpecialArgv';
// 0 node, 1 beemo, 2 command
const { main, parallel } = parseSpecialArgv(process.argv.slice(2));
// Initialize
const binName = path.basename(process.argv[1]).replace('.js', ''); // Windows has an ext
const beemo = new Beemo(main.slice(1), binName);
const app = yargs(main);
const manualURL = process.env.BEEMO_MANUAL_URL || 'https://milesj.gitbook.io/beemo';
// Bootstrap the module
beemo.bootstrapConfigModule();
// Register global options
beemo.bootstrapCLI(app);
// Add a command for each driver
beemo.getPlugins('driver').forEach(driver => {
const { command, metadata } = driver;
app.command(
driver.name,
metadata.description || beemo.msg('app:run', { title: metadata.title }),