diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-04-29 23:23:54 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-04-29 23:23:54 +0200 |
commit | faf18476b159c81959a9b79b14e15e296c2af2ed (patch) | |
tree | f356b47602ccdd3742585bba7301401dfc0d0cc4 /lib | |
parent | 9acccad23add2670169652bd88e2045cb15ef6f7 (diff) | |
download | gitbook-faf18476b159c81959a9b79b14e15e296c2af2ed.zip gitbook-faf18476b159c81959a9b79b14e15e296c2af2ed.tar.gz gitbook-faf18476b159c81959a9b79b14e15e296c2af2ed.tar.bz2 |
Don't fail if page doesn't exist
Diffstat (limited to 'lib')
-rw-r--r-- | lib/output/__tests__/website.js | 15 | ||||
-rw-r--r-- | lib/parse/parsePagesList.js | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/lib/output/__tests__/website.js b/lib/output/__tests__/website.js index 54938c8..6b949a4 100644 --- a/lib/output/__tests__/website.js +++ b/lib/output/__tests__/website.js @@ -26,6 +26,21 @@ describe('WebsiteGenerator', function() { }); }); + pit('should not generate file if entry file doesn\'t exist', function() { + return generateMock(WebsiteGenerator, { + 'README.md': 'Hello World', + 'SUMMARY.md': '# Summary\n\n* [Page 1](page.md)\n* [Page 2](test/page.md)', + 'test': { + 'page.md': 'Hello 2' + } + }) + .then(function(folder) { + expect(folder).toHaveFile('index.html'); + expect(folder).not.toHaveFile('page.html'); + expect(folder).toHaveFile('test/page.html'); + }); + }); + pit('should generate a multilingual book', function() { return generateMock(WebsiteGenerator, { 'LANGS.md': '# Languages\n\n* [en](en)\n* [fr](fr)', diff --git a/lib/parse/parsePagesList.js b/lib/parse/parsePagesList.js index 36fcdec..e356e88 100644 --- a/lib/parse/parsePagesList.js +++ b/lib/parse/parsePagesList.js @@ -28,6 +28,8 @@ function parsePagesList(book) { filepath, Page.createForFile(file) ); + }, function() { + // file doesn't exist }); }) .then(function() { |