From 42d909679e4e6d270dea15296430415495339c27 Mon Sep 17 00:00:00 2001 From: Andrew Kostka Date: Wed, 5 Feb 2014 18:20:34 -0800 Subject: [PATCH] allow authentication on mkcouchdb and rmcouchdb --- tasks/couchapp.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/couchapp.js b/tasks/couchapp.js index 6b7811f..f8e6714 100644 --- a/tasks/couchapp.js +++ b/tasks/couchapp.js @@ -33,7 +33,7 @@ module.exports = function(grunt) { parts = urls.parse(this.data.db); dbname = parts.pathname.replace(/^\//, ''); try { - nano = require('nano')(parts.protocol + '//' + parts.host); + nano = require('nano')(parts.protocol + '//' + parts.auth + '@' + parts.host); nano.db.destroy(dbname, function(err) { if (err) { if (err.status_code && err.status_code === 404) { @@ -62,7 +62,7 @@ module.exports = function(grunt) { parts = urls.parse(this.data.db); dbname = parts.pathname.replace(/^\//, ''); try { - nano = require('nano')(parts.protocol + '//' + parts.host); + nano = require('nano')(parts.protocol + '//' + parts.auth + '@' + parts.host); nano.db.create(dbname, function(err) { if (_this.data.options && _this.data.options.okay_if_exists) { if (err){