Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add additional width to component-ls(1) output

many names are too large
  • Loading branch information...
commit 37afc23e43246d8c56e5bcc61447d644195430c5 1 parent b88b644
@tj tj authored
Showing with 4 additions and 4 deletions.
  1. +2 −2 bin/component-ls
  2. +2 −2 lib/utils.js
View
4 bin/component-ls
@@ -20,6 +20,6 @@ console.log();
fs.readdirSync('components').forEach(function(pkg){
var json = path.resolve('components', pkg, 'component.json');
var obj = require(json);
- log(obj.name, obj.version);
+ log(obj.name, obj.version, 36, 18);
});
-console.log();
+console.log();
View
4 lib/utils.js
@@ -21,9 +21,9 @@ exports.fatal = function(){
* @api public
*/
-exports.log = function(type, msg, color){
+exports.log = function(type, msg, color, w){
color = color || '36';
- var w = 10;
+ var w = w || 10;
var len = Math.max(0, w - type.length);
var pad = Array(len + 1).join(' ');
console.log(' \033[' + color + 'm%s\033[m : \033[90m%s\033[m', pad + type, msg);

0 comments on commit 37afc23

Please sign in to comment.
Something went wrong with that request. Please try again.