Skip to content

Commit

Permalink
Merge pull request #1130 from kasparsd/bug/default-styles
Browse files Browse the repository at this point in the history
Use parsed includeDefaultStyles instead of direct input
  • Loading branch information
Junaid Rasheed authored Jun 19, 2018
2 parents 2c238fd + 8bc518a commit f2445c7
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions lib/styleguide.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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;
Expand Down Expand Up @@ -582,4 +583,4 @@ function startServer(options) {
return serverInstance[options.port];
}

module.exports.addSection = addSection;
module.exports.addSection = addSection;

0 comments on commit f2445c7

Please sign in to comment.