diff --git a/packages/contentstack-audit/src/modules/extensions.ts b/packages/contentstack-audit/src/modules/extensions.ts index f28c4afc77..10d47bc9a4 100644 --- a/packages/contentstack-audit/src/modules/extensions.ts +++ b/packages/contentstack-audit/src/modules/extensions.ts @@ -109,6 +109,7 @@ export default class Extensions { this.fix && (this.config.flags['copy-dir'] || this.config.flags['external-config']?.skipConfirm || + this.config.flags.yes || (await ux.confirm(commonMsg.FIX_CONFIRMATION))) ) { writeFileSync( diff --git a/packages/contentstack-audit/src/modules/workflows.ts b/packages/contentstack-audit/src/modules/workflows.ts index 9cb0067ae5..4ee870fab3 100644 --- a/packages/contentstack-audit/src/modules/workflows.ts +++ b/packages/contentstack-audit/src/modules/workflows.ts @@ -57,7 +57,6 @@ 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[]) @@ -146,8 +145,10 @@ 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.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-migration/src/utils/error-helper.js b/packages/contentstack-migration/src/utils/error-helper.js index 649e16ef99..0ed05d4166 100644 --- a/packages/contentstack-migration/src/utils/error-helper.js +++ b/packages/contentstack-migration/src/utils/error-helper.js @@ -86,8 +86,15 @@ module.exports = (errors, filePath) => { messages.push(`${fileErrorsMessage}${errorMessages}`); logger.log('error', errorLogs); } + if (errors?.request) { + errors.data = errors.request?.data; + delete errors.request; + } + if (errors?.message) { + delete errors.message; + } if (isEmpty(messages) && errors !== undefined && isEmpty(errorsByFile)) { - logger.log('error', errors); + logger.log('error', { errors: errors }); console.log(chalk`{bold.red Migration unsuccessful}`); } else { logger.log('error', { error: messages.join('\n') });