Skip to content

Commit 4bbf0b8

Browse files
committed
add callback to build and patternsonly calls - and are now explicitly deleting when told to do so
1 parent 16bbe3d commit 4bbf0b8

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

core/lib/patternlab.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/*
2-
* patternlab-node - v2.0.0-alpha - 2016
3-
*
1+
/*
2+
* patternlab-node - v2.0.0-alpha - 2016
3+
*
44
* Brian Muenzenmeyer, Geoff Pursell, and the web community.
5-
* Licensed under the MIT license.
6-
*
7-
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
5+
* Licensed under the MIT license.
6+
*
7+
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
88
*
99
*/
1010

@@ -254,6 +254,7 @@ var patternlab_engine = function (config) {
254254

255255
//delete the contents of config.patterns.public before writing
256256
if (deletePatternDir) {
257+
fs.removeSync(paths.public.patterns);
257258
fs.emptyDirSync(paths.public.patterns);
258259
}
259260

@@ -351,17 +352,19 @@ var patternlab_engine = function (config) {
351352
version: function () {
352353
return getVersion();
353354
},
354-
build: function (deletePatternDir) {
355+
build: function (callback, deletePatternDir) {
355356
buildPatterns(deletePatternDir);
356357
buildFrontEnd(patternlab);
357358
printDebug();
359+
callback();
358360
},
359361
help: function () {
360362
help();
361363
},
362-
patternsonly: function (deletePatternDir) {
364+
patternsonly: function (callback, deletePatternDir) {
363365
buildPatterns(deletePatternDir);
364366
printDebug();
367+
callback();
365368
},
366369
liststarterkits: function () {
367370
return listStarterkits();

0 commit comments

Comments
 (0)