Support command line

gh-pages -d dist -b master
This commit is contained in:
afc163
2015-05-08 11:38:45 +08:00
parent 3d2d0dc748
commit 6412a7dac3
3 changed files with 64 additions and 5 deletions

25
bin/gh-pages Executable file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env node
var ghpages = require('../lib/index');
var program = require('commander');
var path = require('path');
program
.version(require('../package').version)
.option('-d, --dist <dist>',
'base directory for all source files')
.option('-s, --src <src>',
'pattern used to select which files should be published', '**/*')
.option('-b, --branch <branch>',
'name of the branch you\'ll be pushing to', 'gh-page')
.parse(process.argv);
ghpages.publish(path.join(process.cwd(), program.dist), {
branch: program.branch,
src: program.src,
logger: function(message) {
console.log(message);
}
}, function() {
console.log('Published');
});