Skip to content
This repository was archived by the owner on May 5, 2024. It is now read-only.

Commit 14dd17e

Browse files
committed
Clear destination before building styleguide
1 parent 1cc6c99 commit 14dd17e

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

index.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,16 @@ module.exports = require('postcss').plugin('mdcss', function (opts) {
151151
list: list,
152152
opts: opts
153153
}).then(function (docs) {
154-
return Promise.all([
155-
fs.copy(docs.assets, opts.destination),
156-
fs.outputFile(path.join(opts.destination, opts.index), docs.template)
157-
]);
154+
// empty the destination directory
155+
return fs.emptyDir(opts.destination)
156+
// then copy the theme assets into the destination
157+
.then(function () {
158+
return fs.copy(docs.assets, opts.destination);
159+
})
160+
// then copy the compiled template into the destination
161+
.then(function () {
162+
return fs.outputFile(path.join(opts.destination, opts.index), docs.template);
163+
});
158164
});
159165
};
160166
});

0 commit comments

Comments
 (0)