Skip to content

Commit

Permalink
feat(cli): add cli entry
Browse files Browse the repository at this point in the history
  • Loading branch information
Clunt committed May 28, 2018
1 parent 44e8266 commit 34fa015
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
30 changes: 29 additions & 1 deletion bin/freepack.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,32 @@
#!/usr/bin/env node


(function() {}());
(function() {
const yargs = require('yargs');
const cli = require('../cli');
const noop = () => {};

[Object.assign({
cmd: '$0'
}, cli)].concat(cli.commands).forEach(command => yargs.command(
command.cmd,
command.desc || '',
command.builder || noop,
command.handler || noop
));

const CONFIG_GROUP = "Config options:";

yargs
.usage(`freepack ${
require('../package.json').version
}
Usage: freepack [options]
freepack <command> [options]`)
.help('help')
.alias('help', 'h')
.version()
.alias('version', 'v')
.argv
}());
10 changes: 10 additions & 0 deletions cli/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"use strict";


exports.commands = [
];

exports.builder = () => {};

exports.handler = argv => {
};
Empty file removed lib/cli.js
Empty file.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"dependencies": {
"fs-extra": "^6.0.1",
"glob": "^7.1.2",
"minimatch": "^3.0.4"
"minimatch": "^3.0.4",
"yargs": "^11.0.0"
},
"devDependencies": {
"commitizen": "^2.9.6",
Expand Down

0 comments on commit 34fa015

Please sign in to comment.