Fixed bug when adding attachments to design doc that uses a directory-based app structure.

This commit is contained in:
Sam Hiatt 2014-09-19 17:04:05 -07:00
parent 508e1eec96
commit f7b70e9f5e
1 changed files with 3 additions and 0 deletions

View File

@ -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)))
}