Skip to content

Commit

Permalink
Merge pull request #1334 from contentstack/bugfix/CS-44326
Browse files Browse the repository at this point in the history
CS-44326-added optional chaining
  • Loading branch information
cs-raj authored Mar 8, 2024
2 parents 7776900 + 8c20b76 commit 8e0a23a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const setupConfig = async (exportCmdFlags: any): Promise<ExportConfig> => {
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',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export default class ContentTypesImport extends BaseClass {

async updatePendingExtensions(): Promise<any> {
let apiContent = fsUtil.readFile(this.extPendingPath) as Record<string, any>[];
if (apiContent.length === 0) {
if (apiContent?.length === 0) {
log(this.importConfig, `No extensions found to be updated.`, 'success');
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const setupConfig = async (importCmdFlags: any): Promise<ImportConfig> => {
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',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-utilities/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
Expand Down

0 comments on commit 8e0a23a

Please sign in to comment.