Skip to content
Browse files

add better cli output for some examples

  • Loading branch information...
1 parent 9f6bf38 commit ec8db5bb021117cf651d34b0deb43e2bfd317b9f @tellnes committed May 28, 2012
Showing with 20 additions and 17 deletions.
  1. +4 −3 examples/listDistributions.js
  2. +7 −5 examples/setDistributionOAI.js
  3. +6 −8 examples/setDistributionTrustedSigners.js
  4. +3 −1 package.json
View
7 examples/listDistributions.js
@@ -1,11 +1,12 @@
-var cloudfront = require('..');
+var cloudfront = require('..')
+ , inspect = require('eyes').inspector({maxLength: -1})
var cf = cloudfront.createClient(process.env.AWS_KEY, process.env.AWS_SECRET);
cf.listDistributions({streaming: false}, function(err, list, info) {
if (err) {
- console.error(err);
+ inspect(err)
} else {
- console.log(list);
+ inspect(list)
}
});
View
12 examples/setDistributionOAI.js
@@ -1,8 +1,9 @@
-var cloudfront = require('..');
+var cloudfront = require('..')
+, inspect = require('eyes').inspector({maxLength: -1})
var cf = cloudfront.createClient(process.env.AWS_KEY, process.env.AWS_SECRET);
-cf.getDistributionConfig(process.argv[2], function(err, config) {
+cf.getDistributionConfig(process.argv[2], function(err, config, info) {
if (err) throw err;
var id = process.argv[4] || config.defaultCacheBehavior.targetOriginId
@@ -16,12 +17,13 @@ cf.getDistributionConfig(process.argv[2], function(err, config) {
origin.originAccessIdentity = process.argv[3];
- console.log(config);
- console.log(cf.generateDistributionXml(config));
+
+ inspect(config);
+ inspect(cf.generateDistributionXml(config));
cf.setDistributionConfig(process.argv[2], config, function(err, config2) {
if (err) throw err;
- console.log(config2);
+ inspect(config2);
});
});
View
14 examples/setDistributionTrustedSigners.js
@@ -1,23 +1,21 @@
-var util = require('util');
-var cloudfront = require('..');
+var cloudfront = require('..')
+ , inspect = require('eyes').inspector({maxLength: -1})
var cf = cloudfront.createClient(process.env.AWS_KEY, process.env.AWS_SECRET);
-cf.getDistributionConfig(process.argv[2], function(err, config) {
+cf.getDistributionConfig(process.argv[2], function(err, config, info) {
if (err) throw err;
config.defaultCacheBehavior.trustedSigners.enabled = true
;[].push.apply(config.defaultCacheBehavior.trustedSigners, process.argv.slice(3));
-
-
- console.log(util.inspect(config, false, 3, true));
- console.log(cf.generateDistributionXml(config));
+ inspect(config)
+ inspect(cf.generateDistributionXml(config))
cf.setDistributionConfig(process.argv[2], config, function(err, distribution) {
if (err) throw err;
- console.log(util.inspect(distribution, false, 3, true));
+ inspect(distribution)
});
});
View
4 package.json
@@ -18,7 +18,9 @@
"data2xml": "~0.4.0",
"xml2js": "~0.1.13"
},
- "devDependencies": {},
+ "devDependencies": {
+ "eyes": "~0.1.7"
+ },
"optionalDependencies": {},
"engines": {
"node": "*"

0 comments on commit ec8db5b

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