Skip to content

Fix param spam during deployment #1587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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