Bamieh/reflow

View on GitHub
packages/reflow-cli/bin/_reflow.js

Summary

Maintainability
A
0 mins
Test Coverage
#!/usr/bin/env node
'use strict';

const Yargs = require('yargs');
const findUp = require('find-up')

const getConfigs = require('./parse-configs');
const configPath = findUp.sync(['.reflowrc', '.reflowrc.json', 'config.yml'])
const config = getConfigs(configPath);

Yargs
  .commandDir('./commands')
  .config(config)
  .env('REFLOW')
  .showHelpOnFail(true)
  .command({
    command: '*',
    handler() {
      Yargs.showHelp()
    }
  })
  .demandCommand()
  .version()
  .help()
  .argv