mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
tag: fixes for project structure changes
This commit is contained in:
parent
3bd1ac211c
commit
d2971fe535
@ -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;
|
||||
|
||||
@ -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);
|
||||
});
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user