From ed33974cd3ee35d8a84d182d436eb0a622149899 Mon Sep 17 00:00:00 2001 From: "Johannes J. Schmidt" Date: Wed, 18 Dec 2013 14:52:56 +0100 Subject: [PATCH] fix auth options --- index.js | 21 ++++++++++++++++----- package.json | 4 ++-- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index a3154bd..6095024 100755 --- a/index.js +++ b/index.js @@ -21,11 +21,14 @@ var noop = function() {}; couchmagick.get({ address: 'httpd.bind_address', port: 'httpd.port', - // auth: { - // username: pkg.name + '.username', - // password: pkg.name + '.password' - // } -}, function(config) { + auth: { + username: pkg.name + '.username', + password: pkg.name + '.password' + } +}, function(err, config) { + if (err) { + return process.exit(0); + } var auth = config.auth && config.auth.username && config.auth.password ? [config.auth.username, config.auth.password].join(':') : @@ -57,9 +60,17 @@ couchmagick.get({ } nano(couch).db.list(function(err, dbs) { + if (err) { + console.log(err); + couchmagick.error('Can not get _all_dbs: ' + err.description); + + return process.exit(0); + } + async.eachSeries(dbs, listen, function() { couchmagick.info('done.'); process.exit(0); + }); }); diff --git a/package.json b/package.json index 673a7ff..91eb209 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "couchmagick", - "version": "0.1.1", + "version": "0.1.2", "description": "Run ImageMagicks `convert` on CouchDB documents.", "main": "index.js", "preferGlobal": true, @@ -30,7 +30,7 @@ "async": "~0.2.9", "event-stream": "~3.0.20", "couchmagick-listen": "~1.0.6", - "couch-daemon": "~1.1.3", + "couch-daemon": "~1.1.4", "nano": "~4.2.1" }, "devDependencies": {