UNPKG

bob-the-bundler

Version:
24 lines (23 loc) 764 B
#!/usr/bin/env node import yargs from 'yargs'; import { hideBin } from 'yargs/helpers'; import consola from 'consola'; import { buildCommand } from './commands/build.js'; import { runifyCommand } from './commands/runify.js'; import { bootstrapCommand } from './commands/bootstrap.js'; import { checkCommand } from './commands/check.js'; async function main() { const root = yargs(hideBin(process.argv)).scriptName('bob').detectLocale(false).version(); const commands = [ buildCommand, runifyCommand, bootstrapCommand, checkCommand, ]; const reporter = consola.create({}); commands .reduce((cli, cmd) => cli.command(cmd({ reporter })), root) .help() .showHelpOnFail(false).argv; } main();