netlify-plugin-cloudinary icon indicating copy to clipboard operation
netlify-plugin-cloudinary copied to clipboard

[Feature] Warn if cloudname configs are different

Open colbyfayock opened this issue 2 years ago • 4 comments

Feature Request

Is your feature request related to a problem? Please describe.

You can configure cloud name in both an environment variable and in a plugin input - if both are different values, we should warn in the logs that this is the case to help debugging.

colbyfayock avatar Nov 17 '23 17:11 colbyfayock

Hey, please allow me to fix this

module.exports = {
  onPreBuild: ({ inputs, utils }) => {
    const envCloudName = process.env.CLOUDINARY_CLOUD_NAME;
    const inputCloudName = inputs.cloudName;

    if (envCloudName && inputCloudName && envCloudName !== inputCloudName) {
      utils.build.warn(`Cloudinary cloud names differ: Environment Cloud Name is "${envCloudName}" but Plugin Cloud Name is "${inputCloudName}".`);
    }
  },
};

nishant05gaurav avatar Oct 01 '24 15:10 nishant05gaurav

all yours!

colbyfayock avatar Oct 01 '24 17:10 colbyfayock

thankyou!!

nishant05gaurav avatar Oct 01 '24 18:10 nishant05gaurav