couchdb-update-views
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -28,3 +28,3 @@ #! /usr/bin/env node | ||
if (err) { return callback(err) } | ||
getDB(config, function (err, db) { | ||
getDB(couch, function (err, db) { | ||
getDocs(docsDir, function (err, files) { | ||
@@ -31,0 +31,0 @@ async.forEach( |
17
getDB.js
var cradle = require('cradle') | ||
var inspect = require('eyespect').inspector() | ||
module.exports = function (config, cb) { | ||
var host = config.get('couch:host') | ||
var port = config.get('couch:port') | ||
var databaseName = config.get('couch:database') | ||
module.exports = function (couch, cb) { | ||
var host = couch.host | ||
var protocol = couch.protocol | ||
var fullHost = protocol + '://'+host | ||
var port = couch.port | ||
var databaseName = couch.database | ||
var opts = { | ||
@@ -13,4 +14,4 @@ cache: false, | ||
var username = config.get('couch:username') | ||
var password = config.get('couch:password') | ||
var username = couch.username | ||
var password = couch.password | ||
@@ -24,3 +25,3 @@ if (username) { | ||
var c = new(cradle.Connection)(host, port, opts) | ||
var c = new(cradle.Connection)(fullHost, port, opts) | ||
var db = c.database(databaseName) | ||
@@ -27,0 +28,0 @@ var createData = { |
{ | ||
"name": "couchdb-update-views", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Keep couchdb views up to date", | ||
@@ -5,0 +5,0 @@ "main": "sync.js", |
14492
435