diff --git a/lib/init.js b/lib/init.js index 83f8d98f6b..e927f331e5 100644 --- a/lib/init.js +++ b/lib/init.js @@ -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', diff --git a/lib/loaders/config.js b/lib/loaders/config.js index eaa8c8836c..c951e76030 100644 --- a/lib/loaders/config.js +++ b/lib/loaders/config.js @@ -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. diff --git a/lib/plugins/console/help.js b/lib/plugins/console/help.js index 5cfc9f7c3b..849749d863 100644 --- a/lib/plugins/console/help.js +++ b/lib/plugins/console/help.js @@ -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'}