Skip to content

Commit

Permalink
add Global Option '--config' to specify config file insted of using _…
Browse files Browse the repository at this point in the history
…config.yml
  • Loading branch information
chenall committed Jan 12, 2014
1 parent 963103d commit ef300c0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ module.exports = function(cwd, args, callback){
if (typeof callback !== 'function') callback = function(){};

var hexo = global.hexo = new Hexo();
var configfile = args.config || '_config.yml';

hexo.bootstrap(cwd, args);
hexo.configfile = path.join(hexo.base_dir,configfile);

async.eachSeries([
'logger',
Expand Down
2 changes: 1 addition & 1 deletion lib/loaders/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ var joinPath = function(){

module.exports = function(callback){
var baseDir = hexo.base_dir,
configPath = path.join(baseDir, '_config.yml');
configPath = hexo.configfile;

/**
* Configuration.
Expand Down
1 change: 1 addition & 0 deletions lib/plugins/console/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ module.exports = function(args, callback){

result = result.concat(commandList('Commands:', commands), '');
result = result.concat(commandList('Global Options:', [
{name: '--config=[FILE]', desc: 'Specify config file instead of using _config.yml'},
{name: '--debug', desc: 'Display all verbose messages in the terminal'},
{name: '--safe', desc: 'Disable all plugins and scripts'},
{name: '--silent', desc: 'Hide output on console'}
Expand Down

0 comments on commit ef300c0

Please sign in to comment.