Merge pull request #8 from samhiatt/master

Fixed bug when adding attachments to directory-based couchapp.
This commit is contained in:
Diana Thayer 2014-09-21 08:18:37 -07:00
commit 91912c2baa
3 changed files with 11 additions and 8 deletions

View File

@ -1,7 +1,6 @@
# grunt-couchapp
A grunt plugin for building and installing couchapps,
forked from https://github.com/garbados/grunt-couchapp
A grunt plugin for building and installing couchapps
## Getting Started

View File

@ -4,18 +4,19 @@
"version": "0.2.2",
"homepage": "https://github.com/garbados/grunt-couchapp",
"author": {
"name":"Sam Hiatt",
"email": "sam.hiatt@weather.com"
},
"contributors": [
{
"name": "Ken Elf Mathieu Sternberg",
"email": "elf.sternberg@gmail.com",
"url": "http://elfsternberg.com"
},{
},
"contributors": [
{
"name": "Max Thayer",
"email": "garbados@gmail.com",
"url": "http://maxthayer.org"
},
{
"name":"Sam Hiatt",
"email": "sam.hiatt@weather.com"
}
],
"repository": {

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