mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-10-08 06:11:38 +00:00
Fix init command
This commit is contained in:
@@ -18,7 +18,8 @@ GitBook can be installed from **NPM** using:
|
||||
$ npm install gitbook-cli -g
|
||||
```
|
||||
|
||||
Create the directories and files for a book from its [SUMMARY.md](https://github.com/GitbookIO/gitbook#book-format) file using
|
||||
Create the directories and files for a book from its [SUMMARY.md](https://github.com/GitbookIO/gitbook#book-format) file (if existing) using
|
||||
|
||||
```
|
||||
$ gitbook init
|
||||
```
|
||||
|
||||
+4
-4
@@ -712,10 +712,10 @@ Book.init = function(root) {
|
||||
}, []);
|
||||
};
|
||||
|
||||
book.log.infoLn("init book at", root);
|
||||
book.log.info.ln("init book at", root);
|
||||
return fs.mkdirp(root)
|
||||
.then(function() {
|
||||
book.log.infoLn("detect structure from SUMMARY (if it exists)");
|
||||
book.log.info.ln("detect structure from SUMMARY (if it exists)");
|
||||
return book.parseSummary();
|
||||
})
|
||||
.fail(function() {
|
||||
@@ -748,7 +748,7 @@ Book.init = function(root) {
|
||||
|
||||
return fs.exists(absolutePath)
|
||||
.then(function(exists) {
|
||||
book.log.infoLn("create", chapter.path);
|
||||
book.log.info.ln("create", chapter.path);
|
||||
if(exists) return;
|
||||
|
||||
return fs.mkdirp(path.dirname(absolutePath))
|
||||
@@ -759,7 +759,7 @@ Book.init = function(root) {
|
||||
}));
|
||||
})
|
||||
.then(function() {
|
||||
book.log.infoLn("initialization is finished");
|
||||
book.log.info.ln("initialization is finished");
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user