diff --git a/packages/contentstack-audit/src/messages/index.ts b/packages/contentstack-audit/src/messages/index.ts index d35307a375..301c7069cf 100644 --- a/packages/contentstack-audit/src/messages/index.ts +++ b/packages/contentstack-audit/src/messages/index.ts @@ -35,7 +35,7 @@ const auditMsg = { SCAN_ENTRY_SUCCESS_MSG: "Successfully completed the scanning of {module} ({local}) '{title}'.", 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', - SCAN_WF_SUCCESS_MSG: 'Successfully removed the workflow with UID {uid} and name {name}.', + SCAN_WF_SUCCESS_MSG: 'Successfully completed the scanning of workflow with UID {uid} and name {name}.', }; const auditFixMsg = { diff --git a/packages/contentstack-audit/src/modules/extensions.ts b/packages/contentstack-audit/src/modules/extensions.ts index 4b07481417..f28c4afc77 100644 --- a/packages/contentstack-audit/src/modules/extensions.ts +++ b/packages/contentstack-audit/src/modules/extensions.ts @@ -79,7 +79,7 @@ export default class Extensions { if (this.fix && this.missingCtInExtensions.length) { await this.fixExtensionsScope(cloneDeep(this.missingCtInExtensions)); this.missingCtInExtensions.forEach((ext) => (ext.fixStatus = 'Fixed')); - return this.missingCtInExtensions + return this.missingCtInExtensions; } return this.missingCtInExtensions; } @@ -106,7 +106,7 @@ export default class Extensions { async writeFixContent(fixedExtensions: Record) { if ( - this.fix || + this.fix && (this.config.flags['copy-dir'] || this.config.flags['external-config']?.skipConfirm || (await ux.confirm(commonMsg.FIX_CONFIRMATION))) diff --git a/packages/contentstack-audit/src/modules/workflows.ts b/packages/contentstack-audit/src/modules/workflows.ts index cd12a1d137..9cb0067ae5 100644 --- a/packages/contentstack-audit/src/modules/workflows.ts +++ b/packages/contentstack-audit/src/modules/workflows.ts @@ -57,6 +57,7 @@ export default class Workflows { return {}; } + this.workflowPath = join(this.folderPath, this.fileName); this.workflowSchema = existsSync(this.workflowPath) ? values(JSON.parse(readFileSync(this.workflowPath, 'utf8')) as Workflow[]) @@ -87,7 +88,7 @@ export default class Workflows { this.log( $t(auditMsg.SCAN_WF_SUCCESS_MSG, { name: workflow.name, - module: this.config.moduleConfig[this.moduleName].name, + uid: workflow.uid, }), 'info', ); @@ -144,9 +145,9 @@ export default class Workflows { async writeFixContent(newWorkflowSchema: Record) { if ( - this.fix || - (!(this.config.flags['copy-dir'] || this.config.flags['external-config']?.skipConfirm) && - (this.config.flags.yes || (await ux.confirm(commonMsg.FIX_CONFIRMATION)))) + this.fix && + !(this.config.flags['copy-dir'] || this.config.flags['external-config']?.skipConfirm) && + (this.config.flags.yes || (await ux.confirm(commonMsg.FIX_CONFIRMATION))) ) { writeFileSync( join(this.folderPath, this.config.moduleConfig[this.moduleName].fileName), diff --git a/packages/contentstack-import/src/import/module-importer.ts b/packages/contentstack-import/src/import/module-importer.ts index 6e1deec080..6970d7d8dd 100755 --- a/packages/contentstack-import/src/import/module-importer.ts +++ b/packages/contentstack-import/src/import/module-importer.ts @@ -49,7 +49,7 @@ class ModuleImporter { if ( !this.importConfig.skipAudit && (!this.importConfig.moduleName || - ['content-types', 'global-fields', 'entries'].includes(this.importConfig.moduleName)) + ['content-types', 'global-fields', 'entries', 'extensions', 'workflows'].includes(this.importConfig.moduleName)) ) { if (!(await this.auditImportData(logger))) { return { noSuccessMsg: true };