use grunt's dynamic filenames.
This commit is contained in:
parent
0b295a3e15
commit
81f490a1f5
|
@ -10,6 +10,8 @@ var path, couchapp, nanolib, urls;
|
||||||
path = require('path');
|
path = require('path');
|
||||||
couchapp = require('couchapp');
|
couchapp = require('couchapp');
|
||||||
urls = require('url');
|
urls = require('url');
|
||||||
|
console.log(__dirname)
|
||||||
|
var async = require('async')
|
||||||
|
|
||||||
module.exports = function(grunt) {
|
module.exports = function(grunt) {
|
||||||
|
|
||||||
|
@ -18,12 +20,17 @@ module.exports = function(grunt) {
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
grunt.registerMultiTask("couchapp", "Install Couchapp", function() {
|
grunt.registerMultiTask("couchapp", "Install Couchapp", function() {
|
||||||
var appobj, done;
|
|
||||||
done = this.async();
|
var task = this
|
||||||
appobj = require(path.join(process.cwd(), path.normalize(this.data.app)));
|
var done = this.async()
|
||||||
return couchapp.createApp(appobj, this.data.db, function(app) {
|
|
||||||
return app.push(done);
|
async.each(this.files, function(file, cb) {
|
||||||
|
var pth = path.join(process.cwd(), path.normalize(file.src[0]))
|
||||||
|
var appobj = require(pth)
|
||||||
|
couchapp.createApp(appobj, task.data.db, function(app) {
|
||||||
|
app.push( cb )
|
||||||
});
|
});
|
||||||
|
}, done)
|
||||||
});
|
});
|
||||||
|
|
||||||
grunt.registerMultiTask("rmcouchdb", "Delete a Couch Database", function() {
|
grunt.registerMultiTask("rmcouchdb", "Delete a Couch Database", function() {
|
||||||
|
|
Loading…
Reference in New Issue