Skip to content

Commit 63a89ea

Browse files
committed
core side of starterkit list wiring
1 parent c84e70c commit 63a89ea

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

core/lib/patternlab.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/*
2-
* patternlab-node - v2.0.0 - 2016
3-
*
1+
/*
2+
* patternlab-node - v2.0.0 - 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

@@ -75,14 +75,14 @@ var patternlab_engine = function (config) {
7575
buildFrontEnd = require('./ui_builder'),
7676
he = require('html-entities').AllHtmlEntities,
7777
plutils = require('./utilities'),
78+
sm = require('./starterkit_manager'),
7879
patternlab = {};
7980

8081
patternlab.package = fs.readJSONSync(path.resolve(__dirname, '../../package.json'));
8182
patternlab.config = config || fs.readJSONSync(path.resolve(__dirname, '../../patternlab-config.json'));
8283

8384
var paths = patternlab.config.paths;
8485

85-
8686
function getVersion() {
8787
console.log(patternlab.package.version);
8888
}
@@ -132,7 +132,10 @@ var patternlab_engine = function (config) {
132132
}
133133
}
134134

135-
135+
function listStarterkits() {
136+
var starterkit_manager = new sm(patternlab);
137+
return starterkit_manager.list_starterkits();
138+
}
136139

137140
function buildPatterns(deletePatternDir) {
138141
try {
@@ -313,6 +316,9 @@ var patternlab_engine = function (config) {
313316
build_patterns_only: function (deletePatternDir) {
314317
buildPatterns(deletePatternDir);
315318
printDebug();
319+
},
320+
list_starterkits: function () {
321+
return listStarterkits();
316322
}
317323
};
318324
};

core/lib/starterkit_manager.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ var starterkit_manager = function (pl) {
88
paths = pl.config.paths;
99

1010
function loadStarterKit(starterkitName) {
11+
try {
12+
var kit = require(starterkitName);
13+
} catch (ex) {
14+
console.log(ex);
15+
console.log(starterkitName + ' not found, please use npm to install it first');
16+
}
17+
console.log(kit);
18+
1119

1220
}
1321

0 commit comments

Comments
 (0)