Fixed bug when adding attachments to design doc that uses a directory-based app structure.
This commit is contained in:
parent
508e1eec96
commit
f7b70e9f5e
|
@ -34,6 +34,9 @@ module.exports = function(grunt) {
|
||||||
done = this.async();
|
done = this.async();
|
||||||
if (require("fs").lstatSync(this.data.app).isDirectory()) { // if new-style (directory-based) couchapp app
|
if (require("fs").lstatSync(this.data.app).isDirectory()) { // if new-style (directory-based) couchapp app
|
||||||
appobj = couchapp.loadFiles(this.data.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.
|
} else { // otherwise, fall back to old style.
|
||||||
appobj = require(path.join(process.cwd(), path.normalize(this.data.app)))
|
appobj = require(path.join(process.cwd(), path.normalize(this.data.app)))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue