Skip to content

Commit

Permalink
Fix param spam during deployment (#1587)
Browse files Browse the repository at this point in the history
  • Loading branch information
barrasso authored Oct 29, 2021
1 parent 0743256 commit 94987e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 25 deletions.
26 changes: 2 additions & 24 deletions publish/src/commands/deploy/get-deploy-parameter-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ const { yellow } = require('chalk');

const { defaults } = require('../../../..');

const { confirmAction } = require('../../util');

module.exports = ({ params, yes, ignoreCustomParameters }) => async name => {
module.exports = ({ params, ignoreCustomParameters }) => async name => {
const defaultParam = defaults[name];
if (ignoreCustomParameters) {
return defaultParam;
Expand All @@ -17,27 +15,7 @@ module.exports = ({ params, yes, ignoreCustomParameters }) => async name => {
const param = (params || []).find(p => p.name === name);

if (param) {
if (!yes) {
try {
await confirmAction(
yellow(
`⚠⚠⚠ WARNING: Found an entry for ${
param.name
} in params.json. Specified value is ${JSON.stringify(
param.value
)} and default is ${JSON.stringify(defaultParam)}.` +
'\nDo you want to use the specified value (default otherwise)? (y/n) '
)
);

effectiveValue = param.value;
} catch (err) {
console.error(err);
}
} else {
// yes = true
effectiveValue = param.value;
}
effectiveValue = param.value;
}

if (effectiveValue !== defaultParam) {
Expand Down
2 changes: 1 addition & 1 deletion publish/src/commands/deploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const deploy = async ({
freshDeploy,
});

const getDeployParameter = getDeployParameterFactory({ params, yes, ignoreCustomParameters });
const getDeployParameter = getDeployParameterFactory({ params, ignoreCustomParameters });

const addressOf = c => (c ? c.address : '');
const sourceOf = c => (c ? c.source : '');
Expand Down

0 comments on commit 94987e3

Please sign in to comment.