couchdb-update-views
Advanced tools
Comparing version 1.0.6 to 1.0.7
32
cli.js
#! /usr/bin/env node | ||
var async = require('async') | ||
var validateConfig = require('./lib/validateConfig') | ||
var should = require('should') | ||
@@ -25,17 +26,20 @@ var inspect = require('eyespect').inspector() | ||
} | ||
getDB(config, function (err, db) { | ||
getDocs(docsDir, function (err, files) { | ||
async.forEach( | ||
files, | ||
function(file, cb) { | ||
validateConfig(couch, function (err, reply) { | ||
if (err) { return callback(err) } | ||
getDB(config, function (err, db) { | ||
getDocs(docsDir, function (err, files) { | ||
async.forEach( | ||
files, | ||
function(file, cb) { | ||
var filePath = file.filePath | ||
inspect(filePath, 'updating document at path') | ||
var docPath = '_design/' + file.fileName.replace(/\.js/,'') | ||
var doc = require(filePath) | ||
inspect(docPath, 'docPath') | ||
update(db, docPath, doc, cb) | ||
}, | ||
callback | ||
) | ||
var filePath = file.filePath | ||
inspect(filePath, 'updating document at path') | ||
var docPath = '_design/' + file.fileName.replace(/\.js/,'') | ||
var doc = require(filePath) | ||
inspect(docPath, 'docPath') | ||
update(db, docPath, doc, cb) | ||
}, | ||
callback | ||
) | ||
}) | ||
}) | ||
@@ -42,0 +46,0 @@ }) |
{ | ||
"name": "couchdb-update-views", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Keep couchdb views up to date", | ||
@@ -5,0 +5,0 @@ "main": "sync.js", |
14490
433