diff options
-rw-r--r-- | lib/generators/website.js | 7 | ||||
-rw-r--r-- | test/ebook.js | 10 |
2 files changed, 11 insertions, 6 deletions
diff --git a/lib/generators/website.js b/lib/generators/website.js index 1143fe5..efb7c0f 100644 --- a/lib/generators/website.js +++ b/lib/generators/website.js @@ -49,7 +49,12 @@ Generator.prototype.prepareStyles = function() { this.styles = _.chain(this.styles) .map(function(style) { var stylePath = that.options.styles[style]; - if (stylePath && fs.existsSync(that.book.resolveOutput(stylePath))) { + var styleExists = ( + fs.existsSync(that.book.resolveOutput(stylePath)) || + fs.existsSync(that.book.resolve(stylePath)) + ); + + if (stylePath && styleExists) { return [style, stylePath]; } return null; diff --git a/test/ebook.js b/test/ebook.js index 6c84462..5caf28b 100644 --- a/test/ebook.js +++ b/test/ebook.js @@ -36,6 +36,11 @@ describe('eBook generator', function () { }); }); + it('should correctly copy print.css', function() { + book.should.have.file('styles'); + book.should.have.file('styles/print.css'); + }); + it('should remove default print.css', function() { var PAGE = fs.readFileSync( path.join(book.options.output, 'index.html'), @@ -61,10 +66,5 @@ describe('eBook generator', function () { } }); }); - - it('should correctly copy print.css', function() { - book.should.have.file('styles'); - book.should.have.file('styles/print.css'); - }); }); }); |