From f7b70e9f5ebdd7c37be37b4efdadce8084c26a70 Mon Sep 17 00:00:00 2001 From: Sam Hiatt Date: Fri, 19 Sep 2014 17:04:05 -0700 Subject: [PATCH] Fixed bug when adding attachments to design doc that uses a directory-based app structure. --- tasks/couchapp.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tasks/couchapp.js b/tasks/couchapp.js index 0d24d33..17104c4 100755 --- a/tasks/couchapp.js +++ b/tasks/couchapp.js @@ -34,6 +34,9 @@ module.exports = function(grunt) { done = this.async(); if (require("fs").lstatSync(this.data.app).isDirectory()) { // if new-style (directory-based) couchapp app appobj = couchapp.loadFiles(this.data.app); + delete appobj._attachments; + delete appobj['']; + couchapp.loadAttachments(appobj, this.data.app+"/_attachments"); } else { // otherwise, fall back to old style. appobj = require(path.join(process.cwd(), path.normalize(this.data.app))) }