mirror of
https://github.com/rschamp/gh-pages.git
synced 2026-04-21 18:03:44 +08:00
Support command line
gh-pages -d dist -b master
This commit is contained in:
25
bin/gh-pages
Executable file
25
bin/gh-pages
Executable 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');
|
||||
});
|
||||
Reference in New Issue
Block a user