tag: fixes for project structure changes

This commit is contained in:
Austen Collins 2015-09-30 17:08:12 -07:00
parent 3bd1ac211c
commit d2971fe535
2 changed files with 6 additions and 4 deletions

View File

@ -71,6 +71,7 @@ CMD.prototype.run = Promise.method(function() {
.then(_this._prepareSummary)
.then(_this._renderDash)
.then(function(selectedResources) {
_this._resources = selectedResources;
if (!_this._resources.length) {
return false;

View File

@ -23,6 +23,7 @@ Promise.promisifyAll(fs);
*/
module.exports.tag = function(type, fullPathToAwsmJson, untag) {
untag = !!(untag);
var awsmJsonPath = fullPathToAwsmJson ? fullPathToAwsmJson : path.join(process.cwd(), 'awsm.json');
var awsmJson = require(awsmJsonPath);
@ -60,7 +61,7 @@ module.exports.tagAll = function(JAWS, type, untag) {
return JAWS.validateProject()
.then(function() {
return utils[findAllFunc](JAWS._meta.projectRootPath);
return utils[findAllFunc](path.join(JAWS._meta.projectRootPath, 'aws_modules'));
})
.then(function(awsmJsonPaths) {
var tagQueue = [];
@ -84,12 +85,14 @@ module.exports.tagAll = function(JAWS, type, untag) {
* @param type
* @returns {Promise}
*/
module.exports.listAll = function(JAWS, type) {
var findAllFunc = (type == 'lambda') ? 'findAllLambdas' : 'findAllEndpoints';
return JAWS.validateProject()
.then(function() {
return utils[findAllFunc](JAWS._meta.projectRootPath);
return utils[findAllFunc](path.join(JAWS._meta.projectRootPath, 'aws_modules'));
})
.then(function(lAwsmJsonPaths) {
@ -99,14 +102,12 @@ module.exports.listAll = function(JAWS, type) {
var fullPaths = [];
var attr = (type == 'lambda') ? 'lambda' : 'apiGateway';
lAwsmJsonPaths.forEach(function(ljp) {
var awsmJson = require(ljp);
if (awsmJson[attr] && awsmJson[attr].deploy == true) {
fullPaths.push(ljp);
}
});
return Promise.all(fullPaths);
});
};