Skip to content

Commit 7808bd3

Browse files
author
Chris Raynor
committed
Adding inline template descriptions to firebase bootstrap
1 parent a90f317 commit 7808bd3

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

lib/app.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,27 @@ module.exports = {
328328
console.log(chalk.yellow('----------------------------------------------------'));
329329
console.log(chalk.yellow('Available Templates'));
330330
console.log(chalk.yellow('----------------------------------------------------'));
331-
console.log(templateList.join('\n'));
331+
332+
var longestTemplateLength = 0;
333+
for (var i = 0; i < templateList.length; i++) {
334+
if (templateList[i].length > longestTemplateLength) {
335+
longestTemplateLength = templateList[i].length;
336+
}
337+
}
338+
for (var i = 0; i < templateList.length; i++) {
339+
var key = templateList[i],
340+
template = supportedTemplates[key];
341+
var output = chalk.bold(key);
342+
if (template.description) {
343+
var spacingString = '';
344+
for (var j = longestTemplateLength; j > key.length; j--) {
345+
spacingString += ' ';
346+
}
347+
output += spacingString + ' - ' + template.description;
348+
}
349+
console.log(output);
350+
}
351+
332352
console.log(chalk.yellow('----------------------------------------------------'));
333353
console.log('Choose a template to help you get started with your app');
334354
}

0 commit comments

Comments
 (0)