Permalink
Browse files

Added colorful console output to notify user of assets being added

  • Loading branch information...
1 parent 7c62573 commit 0b828e9faac23101fc8fa7fa8b2099599842e9b9 @Munter committed Jan 24, 2013
Showing with 9 additions and 4 deletions.
  1. +8 −4 bin/assetviz
  2. +1 −0 package.json
View
12 bin/assetviz
@@ -56,15 +56,19 @@ var AssetGraph = require('assetgraph'),
url: query.not(/^https?:/)
}
}),
- assetviz = require('../index.js');
+ assetviz = require('../index.js'),
+ colors = require('colors');
AssetGraph.registerTransform(assetviz, 'assetviz');
-
new AssetGraph({root: rootUrl})
.on('error', function (err) {
- console.error((err.asset ? err.asset.urlOrDescription + ': ' : '') + err.stack);
- process.exit(1);
+ console.error(''.red + err.message);
+ })
+ .on('addAsset', function (asset) {
+ if (asset.url) {
+ console.warn(''.green + asset.url);
+ }
})
.registerRequireJsConfig()
.loadAssets(inputUrls)
View
1 package.json
@@ -21,6 +21,7 @@
"license": "BSD",
"dependencies": {
"assetgraph": "=1.3.2",
+ "colors": "*",
"optimist": "*"
},
"bin": "./bin/assetviz"

0 comments on commit 0b828e9

Please sign in to comment.