Skip to content

Commit b5a7fca

Browse files
committed
Clean up logging when revision key is not defined
1 parent 714c168 commit b5a7fca

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,10 @@ const DeployPlugin = DeployPluginBase.extend({
179179
this.log(`Activating revision \`${revisionKey}'`, { verbose: true });
180180

181181
return deployClient.activateRevision({ tableName, revisionKey })
182-
.then(() => {
182+
.then(args => {
183+
// TODO: replace let with destructured args
184+
let revisionKey = args.revisionKey;
185+
183186
this.log(`✔ Activated revision \`${revisionKey}'`);
184187

185188
return { revisionData: { activatedRevisionKey: revisionKey } };

lib/deploy-client.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ module.exports = CoreObject.extend({
158158
return conditionallyCreateRevision.call(this, tableName, revisionKey, value)
159159
.then(() => listRevisions.call(this, tableName))
160160
.then(trimRevisions.bind(this, tableName))
161-
.then(() => ({ tableName, revisionKey }));
161+
.return({ tableName, revisionKey });
162162
},
163163

164164
activateRevision(args) {
@@ -167,8 +167,11 @@ module.exports = CoreObject.extend({
167167
tableName = args.tableName,
168168
revisionKey = args.revisionKey;
169169

170+
revisionKey = revisionKey || 'default';
171+
170172
return validateRevision.call(this, tableName, revisionKey)
171-
.then(activateRevision.bind(this, tableName));
173+
.then(activateRevision.bind(this, tableName))
174+
.return({ tableName, revisionKey });
172175
},
173176

174177
activeRevisionKey(args) {

0 commit comments

Comments
 (0)