diff --git a/packages/contentstack-audit/src/messages/index.ts b/packages/contentstack-audit/src/messages/index.ts index 7f2d10b847..6ae890e4c0 100644 --- a/packages/contentstack-audit/src/messages/index.ts +++ b/packages/contentstack-audit/src/messages/index.ts @@ -15,8 +15,8 @@ const commonMsg = { CONFIG: 'Path of the external config', DATA_DIR: 'Path where the data is stored', FIX_CONFIRMATION: 'Would you like to overwrite existing file.?', - EXTENSION_FIX_WARN: `Extension {uid} named '{title}' will be removed.`, - EXTENSION_FIX_CONFIRMATION: `Would you like to overwrite existing file.?`, + EXTENSION_FIX_WARN: `The extension associated with UID {uid} and title '{title}' will be removed.`, + EXTENSION_FIX_CONFIRMATION: `Would you like to overwrite existing file?`, }; const auditMsg = { @@ -30,7 +30,7 @@ const auditMsg = { FINAL_REPORT_PATH: "Reports ready. Please find the reports at '{path}'.", SCAN_CT_SUCCESS_MSG: "Successfully completed the scanning of {module} '{title}'.", SCAN_ENTRY_SUCCESS_MSG: "Successfully completed the scanning of {module} ({local}) '{title}'.", - SCAN_EXT_SUCCESS_MSG: "Successfully completed the scanning of {module} titled '{title}' having uid '{uid}'.", + SCAN_EXT_SUCCESS_MSG: "Successfully completed scanning the {module} titled '{title}' with UID '{uid}'", AUDIT_CMD_DESCRIPTION: 'Perform audits and find possible errors in the exported Contentstack data', }; diff --git a/packages/contentstack-audit/src/modules/extensions.ts b/packages/contentstack-audit/src/modules/extensions.ts index 09c4bf8d08..4b07481417 100644 --- a/packages/contentstack-audit/src/modules/extensions.ts +++ b/packages/contentstack-audit/src/modules/extensions.ts @@ -91,11 +91,10 @@ export default class Extensions { for (const ext of missingCtInExtensions) { const { uid, title } = ext; const fixedCts = ext?.scope?.content_types.filter((ct) => !this.missingCts.has(ct)); - if (fixedCts?.length) { + if (fixedCts?.length && newExtensionSchema[uid]?.scope) { newExtensionSchema[uid].scope.content_types = fixedCts; } else { this.log($t(commonMsg.EXTENSION_FIX_WARN, { title: title, uid }), { color: 'yellow' }); - const shouldDelete = this.config.flags.yes || (await ux.confirm(commonMsg.EXTENSION_FIX_CONFIRMATION)); if (shouldDelete) { delete newExtensionSchema[uid];