diff --git a/bin/blog b/bin/blog new file mode 100755 index 0000000..edfada4 --- /dev/null +++ b/bin/blog @@ -0,0 +1,22 @@ +#!/usr/bin/env node + +process.title = 'Blog-Cli' + +var resolve = require('resolve'); +var basepath = process.cwd(); + +resolve('blog-cli-js', { + basedir: basepath +}, function(err, localCLI) { + + var CLI; + if (err) { + CLI = require('../lib/cli'); + } else { + CLI = require(localCLI); + } + + var cli = new CLI(process.argv.slice(2)); + + cli.command(); +}); diff --git a/index.js b/index.js index e69de29..724d105 100644 --- a/index.js +++ b/index.js @@ -0,0 +1 @@ +exports = require('./package'); \ No newline at end of file diff --git a/lib/cli.js b/lib/cli.js new file mode 100644 index 0000000..18521aa --- /dev/null +++ b/lib/cli.js @@ -0,0 +1,12 @@ +"use strict" + +var Cli = require('soil-cli'); + +class BlogCli extends Cli { + + constructor(args, options) { + super(args, options); + } +} + +module.exports = BlogCli; diff --git a/lib/commands.js b/lib/commands.js new file mode 100644 index 0000000..7cdbeaa --- /dev/null +++ b/lib/commands.js @@ -0,0 +1,7 @@ +var helpCommand = require('./commands/help'); + +module.exports = function(args) { + console.log('args', args); +} + +module.exports.help = helpCommand; diff --git a/lib/commands/help.js b/lib/commands/help.js new file mode 100644 index 0000000..15a04bc --- /dev/null +++ b/lib/commands/help.js @@ -0,0 +1,3 @@ +module.exports = function(cli) { + cli.ui('help works'); +} diff --git a/package.json b/package.json index ded89c2..06df060 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/chambersoft/cli-js" + "url": "https://github.com/chambersoft/blog-cli-js" }, "keywords": [ "cli", @@ -17,7 +17,11 @@ "author": "Cole Chamberlain", "license": "MIT", "bugs": { - "url": "https://github.com/chambersoft/cli-js/issues" + "url": "https://github.com/chambersoft/blog-cli-js/issues" }, - "homepage": "https://github.com/chambersoft/cli-js" + "homepage": "https://github.com/chambersoft/blog-cli-js", + "dependencies": { + "resolve": "^1.1.6", + "soil-cli": "^1.2.5" + } }