Merge pull request #8 from samhiatt/master
Fixed bug when adding attachments to directory-based couchapp.
This commit is contained in:
		
						commit
						91912c2baa
					
				|  | @ -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  | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										13
									
								
								package.json
								
								
								
								
							
							
						
						
									
										13
									
								
								package.json
								
								
								
								
							|  | @ -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": { | ||||
|  |  | |||
|  | @ -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))) | ||||
|         } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue