From 8e54ca08bbfcf19eaf9dca56c1fca9131bfa4209 Mon Sep 17 00:00:00 2001 From: John-Henry Liberty Date: Thu, 28 May 2015 14:23:32 -0500 Subject: [PATCH] soil-cli installed and setup --- bin/blog | 22 ++++++++++++++++++++++ index.js | 1 + lib/cli.js | 12 ++++++++++++ lib/commands.js | 7 +++++++ lib/commands/help.js | 3 +++ package.json | 10 +++++++--- 6 files changed, 52 insertions(+), 3 deletions(-) create mode 100755 bin/blog create mode 100644 lib/cli.js create mode 100644 lib/commands.js create mode 100644 lib/commands/help.js 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" + } }