Skip to content

Commit

Permalink
Change path of main file and export console and version
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy351 committed Feb 11, 2016
1 parent 6ad283d commit 77ac134
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
4 changes: 1 addition & 3 deletions bin/hexo
Expand Up @@ -2,6 +2,4 @@

'use strict';

var minimist = require('minimist');

require('../lib/hexo')(process.cwd(), minimist(process.argv.slice(2)));
require('../lib/hexo')();
17 changes: 15 additions & 2 deletions lib/hexo.js
Expand Up @@ -8,9 +8,12 @@ var Promise = require('bluebird');
var Context = require('./context');
var findPkg = require('./find_pkg');
var goodbye = require('./goodbye');
var minimist = require('minimist');

function entry(cwd, args) {
cwd = cwd || process.cwd();
args = util.camelCaseKeys(args || minimist(process.argv.slice(2)));

module.exports = function(cwd, args) {
args = util.camelCaseKeys(args || {});
var hexo = new Context(cwd, args);
var log = hexo.log;

Expand Down Expand Up @@ -65,8 +68,16 @@ module.exports = function(cwd, args) {
});
});
}).catch(handleError);
}

entry.console = {
init: require('./console/init'),
help: require('./console/help'),
version: require('./console/version')
};

entry.version = require('../package.json').version;

function loadModule(path, args) {
return Promise.try(function() {
var modulePath = pathFn.join(path, 'node_modules', 'hexo');
Expand All @@ -86,3 +97,5 @@ function watchSignal(hexo) {
});
});
}

module.exports = entry;
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -2,7 +2,7 @@
"name": "hexo-cli",
"version": "0.2.1",
"description": "Command line interface for Hexo",
"main": "lib/index",
"main": "lib/hexo",
"bin": {
"hexo": "./bin/hexo"
},
Expand Down

0 comments on commit 77ac134

Please sign in to comment.