From d588029873c924e62a93d31d81bea130dfd1393c Mon Sep 17 00:00:00 2001 From: raj pandey Date: Fri, 8 Mar 2024 10:28:06 +0530 Subject: [PATCH 1/2] added optional chaining --- .../contentstack-import/src/import/modules/content-types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/contentstack-import/src/import/modules/content-types.ts b/packages/contentstack-import/src/import/modules/content-types.ts index 9fd9f4e5c3..d026199f7d 100644 --- a/packages/contentstack-import/src/import/modules/content-types.ts +++ b/packages/contentstack-import/src/import/modules/content-types.ts @@ -258,7 +258,7 @@ export default class ContentTypesImport extends BaseClass { async updatePendingExtensions(): Promise { let apiContent = fsUtil.readFile(this.extPendingPath) as Record[]; - if (apiContent.length === 0) { + if (apiContent?.length === 0) { log(this.importConfig, `No extensions found to be updated.`, 'success'); return; } From 8c20b760837ee0fcb70ca9b667c1f491dc02c8a0 Mon Sep 17 00:00:00 2001 From: raj pandey Date: Fri, 8 Mar 2024 10:35:55 +0530 Subject: [PATCH 2/2] Ui text update --- packages/contentstack-export/src/utils/export-config-handler.ts | 2 +- packages/contentstack-import/src/utils/import-config-handler.ts | 2 +- packages/contentstack-utilities/src/helpers.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/contentstack-export/src/utils/export-config-handler.ts b/packages/contentstack-export/src/utils/export-config-handler.ts index 5e57aa3d66..13636f74e3 100644 --- a/packages/contentstack-export/src/utils/export-config-handler.ts +++ b/packages/contentstack-export/src/utils/export-config-handler.ts @@ -20,7 +20,7 @@ const setupConfig = async (exportCmdFlags: any): Promise => { const pattern = /[*$%#<>{}!&?]/g; if (pattern.test(config.exportDir)) { cliux.print( - `\nYour mentioned directory path contains special characters (*,&,{,},[,],$,%,<,>,?,!) please add a path without them`, + `\nPlease add a directory path without any of the special characters: (*,&,{,},[,],$,%,<,>,?,!)`, { color: 'yellow', }, diff --git a/packages/contentstack-import/src/utils/import-config-handler.ts b/packages/contentstack-import/src/utils/import-config-handler.ts index 9fa7d90202..546bfd8a18 100644 --- a/packages/contentstack-import/src/utils/import-config-handler.ts +++ b/packages/contentstack-import/src/utils/import-config-handler.ts @@ -24,7 +24,7 @@ const setupConfig = async (importCmdFlags: any): Promise => { const pattern = /[*$%#<>{}!&?]/g; if (pattern.test(config.contentDir)) { cliux.print( - `\nYour mentioned directory path contains special characters (*,&,{,},[,],$,%,<,>,?,!) please add a path without them`, + `\nPlease add a directory path without any of the special characters: (*,&,{,},[,],$,%,<,>,?,!)`, { color: 'yellow', }, diff --git a/packages/contentstack-utilities/src/helpers.ts b/packages/contentstack-utilities/src/helpers.ts index ea606592c5..6270ca906f 100644 --- a/packages/contentstack-utilities/src/helpers.ts +++ b/packages/contentstack-utilities/src/helpers.ts @@ -42,7 +42,7 @@ export const validatePath = (input: string) => { const pattern = /[*$%#<>{}!&?]/g; if (pattern.test(input)) { cliux.print( - `\nYour mentioned directory path contains special characters (*,&,{,},[,],$,%,<,>,?,!) please add a path without them`, + `\nPlease add a directory path without any of the special characters: (*,&,{,},[,],$,%,<,>,?,!)`, { color: 'yellow', },