mirror of
https://github.com/scratchfoundation/gh-pages.git
synced 2024-11-28 18:25:38 -05:00
32 lines
963 B
JavaScript
Executable file
32 lines
963 B
JavaScript
Executable file
#!/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('-r, --repo <repo>',
|
|
'URL of the repository you\'ll be pushing to')
|
|
.option('-b, --branch <branch>',
|
|
'name of the branch you\'ll be pushing to', 'gh-pages')
|
|
.option('-t, --dotfiles', 'Include dotfiles')
|
|
.option('-a, --add', 'Only add, and never remove existing files.')
|
|
.parse(process.argv);
|
|
|
|
ghpages.publish(path.join(process.cwd(), program.dist), {
|
|
repo: program.repo,
|
|
branch: program.branch,
|
|
src: program.src,
|
|
dotfiles: !!program.dotfiles,
|
|
add: !!program.add,
|
|
logger: function(message) {
|
|
console.log(message);
|
|
}
|
|
}, function() {
|
|
console.log('Published');
|
|
});
|