mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-19 17:15:24 +00:00
Add base command git:push and git:remote
This commit is contained in:
@@ -14,6 +14,7 @@ var fs = require('../lib/generate/fs');
|
||||
var utils = require('./utils');
|
||||
var build = require('./build');
|
||||
var Server = require('./server');
|
||||
var platform = require("./platform");
|
||||
|
||||
// General options
|
||||
prog
|
||||
@@ -115,6 +116,22 @@ prog
|
||||
return initDir(dir);
|
||||
});
|
||||
|
||||
prog
|
||||
.command('git:push [source_dir]')
|
||||
.description('Publish content to the associated gitbook.io book')
|
||||
.action(function(dir) {
|
||||
dir = dir || process.cwd();
|
||||
return platform.publish(dir);
|
||||
});
|
||||
|
||||
prog
|
||||
.command('git:remote [source_dir] [book_id]')
|
||||
.description('Adds a git remote to a book repository')
|
||||
.action(function(dir, bookId) {
|
||||
dir = dir || process.cwd();
|
||||
return platform.remote(dir, bookId);
|
||||
});
|
||||
|
||||
// Parse and fallback to help if no args
|
||||
if(_.isEmpty(prog.parse(process.argv).args) && process.argv.length === 2) {
|
||||
prog.help();
|
||||
|
||||
Reference in New Issue
Block a user