Skip to content

Commit

Permalink
refactor(CLI): Generalize writeServiceOutputs
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Oct 1, 2021
1 parent 85997e0 commit 8aa700d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion lib/cli/write-service-outputs.js
Expand Up @@ -3,7 +3,6 @@
const { writeText, style } = require('@serverless/utils/log');

module.exports = (serviceOutputs) => {
writeText();
for (const [section, entries] of serviceOutputs) {
if (typeof entries === 'string') {
writeText(`${style.aside(`${section}:`)} ${entries}`);
Expand Down
3 changes: 2 additions & 1 deletion lib/plugins/aws/deploy/index.js
Expand Up @@ -12,7 +12,7 @@ const validateTemplate = require('./lib/validateTemplate');
const updateStack = require('../lib/updateStack');
const existsDeploymentBucket = require('./lib/existsDeploymentBucket');
const path = require('path');
const { style, log, progress } = require('@serverless/utils/log');
const { style, log, progress, writeText } = require('@serverless/utils/log');
const memoize = require('memoizee');

const mainProgress = progress.get('main');
Expand Down Expand Up @@ -189,6 +189,7 @@ class AwsDeploy {
)}s)`
)}`
);
writeText();
writeServiceOutputs(this.serverless.serviceOutputs);
},
};
Expand Down
3 changes: 2 additions & 1 deletion lib/plugins/aws/info/index.js
@@ -1,7 +1,7 @@
'use strict';

const BbPromise = require('bluebird');
const { progress } = require('@serverless/utils/log');
const { progress, writeText } = require('@serverless/utils/log');
const writeServiceOutputs = require('../../../cli/write-service-outputs');
const validate = require('../lib/validate');
const getStackInfo = require('./getStackInfo');
Expand Down Expand Up @@ -75,6 +75,7 @@ class AwsInfo {
'finalize': () => {
if (this.serverless.processedInput.commands.join(' ') !== 'info') return;

writeText();
writeServiceOutputs(this.serverless.serviceOutputs);
},
};
Expand Down

0 comments on commit 8aa700d

Please sign in to comment.