Skip to content

Commit

Permalink
chore(serverless-offline-sqs): allow passing queueName from config
Browse files Browse the repository at this point in the history
  • Loading branch information
ossareh committed Aug 17, 2018
1 parent d02f905 commit 8da4b47
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/serverless-offline-sqs/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class ServerlessOfflineSQS {
this.service = serverless.service;
this.options = options;
this.config = this.service.custom['serverless-offline-sqs'];
this.queueName = this.config.QueueName;
delete this.config.QueueName;

this.commands = {};

Expand All @@ -35,6 +37,8 @@ class ServerlessOfflineSQS {
}

getQueueName(queueEvent) {
if (this.queueName) return this.queueName;

if (typeof queueEvent.arn === 'string') return queueEvent.arn.split('/')[1];

if (queueEvent.arn['Fn::GetAtt']) {
Expand Down

0 comments on commit 8da4b47

Please sign in to comment.