Added support for new-style (directory-based) couchapps.
This commit is contained in:
parent
6a8ce0718d
commit
541539cd68
|
@ -32,8 +32,11 @@ module.exports = function(grunt) {
|
||||||
grunt.registerMultiTask("couchapp", "Install Couchapp", function() {
|
grunt.registerMultiTask("couchapp", "Install Couchapp", function() {
|
||||||
var appobj, done;
|
var appobj, done;
|
||||||
done = this.async();
|
done = this.async();
|
||||||
|
if (require("fs").lstatSync(this.data.app).isDirectory()) { // if new-style (directory-based) couchapp app
|
||||||
appobj = require(path.join(process.cwd(), path.normalize(this.data.app)));
|
appobj = couchapp.loadFiles(this.data.app);
|
||||||
|
} else { // otherwise, fall back to old style.
|
||||||
|
appobj = require(path.join(process.cwd(), path.normalize(this.data.app)))
|
||||||
|
}
|
||||||
|
|
||||||
return couchapp.createApp(appobj, this.data.db, function(app) {
|
return couchapp.createApp(appobj, this.data.db, function(app) {
|
||||||
return app.push(done);
|
return app.push(done);
|
||||||
|
|
Loading…
Reference in New Issue