Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Global Option '--config' to specify config file insted of using _config.yml #436

Merged
merged 1 commit into from
Jan 12, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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