diff --git a/lib/styleguide.js b/lib/styleguide.js index c7786422..91b6d624 100644 --- a/lib/styleguide.js +++ b/lib/styleguide.js @@ -254,15 +254,6 @@ function filterFiles(files, filter) { } module.exports.generate = function(options) { - try { - if (options.includeDefaultStyles) { - fs.copySync(distPath + '/css/withstyles/styleguide-app.css', distPath + '/css/styleguide-app.css'); - } else { - fs.copySync(distPath + '/css/withoutstyles/styleguide-app.css', distPath + '/css/styleguide-app.css'); - } - } catch (err) { - console.log('ERROR: Unable to exclude default styles.'); - } var opt = common.sanitizeOptions(options), filesBuffer = {}, throughOpts = { @@ -278,6 +269,16 @@ module.exports.generate = function(options) { ); sgOptions = opt; // Copy options into global + try { + if (opt.includeDefaultStyles) { + fs.copySync(distPath + '/css/withstyles/styleguide-app.css', distPath + '/css/styleguide-app.css'); + } else { + fs.copySync(distPath + '/css/withoutstyles/styleguide-app.css', distPath + '/css/styleguide-app.css'); + } + } catch (err) { + console.log('ERROR: Unable to exclude default styles.'); + } + function bufferFileContents(file, enc, done) { if (file.isNull()) { return; @@ -582,4 +583,4 @@ function startServer(options) { return serverInstance[options.port]; } -module.exports.addSection = addSection; \ No newline at end of file +module.exports.addSection = addSection;