diff --git a/package-lock.json b/package-lock.json index 3fe629c543..2e51e53be0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23147,7 +23147,7 @@ "dependencies": { "@contentstack/cli-auth": "~1.3.13", "@contentstack/cli-cm-bootstrap": "~1.5.0", - "@contentstack/cli-cm-branches": "~1.0.12", + "@contentstack/cli-cm-branches": "~1.0.13", "@contentstack/cli-cm-bulk-publish": "~1.3.11", "@contentstack/cli-cm-clone": "~1.5.0", "@contentstack/cli-cm-export": "~1.9.0", @@ -23329,7 +23329,7 @@ }, "packages/contentstack-branches": { "name": "@contentstack/cli-cm-branches", - "version": "1.0.12", + "version": "1.0.13", "license": "MIT", "dependencies": { "@contentstack/cli-command": "~1.2.12", @@ -26569,7 +26569,7 @@ "requires": { "@contentstack/cli-auth": "~1.3.13", "@contentstack/cli-cm-bootstrap": "~1.5.0", - "@contentstack/cli-cm-branches": "~1.0.12", + "@contentstack/cli-cm-branches": "~1.0.13", "@contentstack/cli-cm-bulk-publish": "~1.3.11", "@contentstack/cli-cm-clone": "~1.5.0", "@contentstack/cli-cm-export": "~1.9.0", diff --git a/packages/contentstack-branches/README.md b/packages/contentstack-branches/README.md index 6d675b4cf7..8a506d885a 100755 --- a/packages/contentstack-branches/README.md +++ b/packages/contentstack-branches/README.md @@ -37,7 +37,7 @@ $ npm install -g @contentstack/cli-cm-branches $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-cm-branches/1.0.12 darwin-arm64 node-v18.11.0 +@contentstack/cli-cm-branches/1.0.13 darwin-arm64 node-v18.11.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND diff --git a/packages/contentstack-branches/package.json b/packages/contentstack-branches/package.json index 2cd38e78f1..01f7c96f69 100644 --- a/packages/contentstack-branches/package.json +++ b/packages/contentstack-branches/package.json @@ -1,7 +1,7 @@ { "name": "@contentstack/cli-cm-branches", "description": "Contentstack CLI plugin to do branches operations", - "version": "1.0.12", + "version": "1.0.13", "author": "Contentstack", "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { diff --git a/packages/contentstack-branches/src/utils/entry-create-script.ts b/packages/contentstack-branches/src/utils/entry-create-script.ts index 682ffb8b0f..435bb4a372 100644 --- a/packages/contentstack-branches/src/utils/entry-create-script.ts +++ b/packages/contentstack-branches/src/utils/entry-create-script.ts @@ -465,7 +465,9 @@ export function entryCreateScript(contentType) { .query({ query: { title: compareRefEntry.title } }) .find(); - updateValueByPath(entryDetails, references[i], baseRefEntry.items[0].uid); + if(baseRefEntry?.items?.length > 0 && baseRefEntry.items[0]?.uid){ + updateValueByPath(entryDetails, references[i], baseRefEntry.items[0].uid); + } } } } diff --git a/packages/contentstack-branches/src/utils/entry-create-update-script.ts b/packages/contentstack-branches/src/utils/entry-create-update-script.ts index 9926436dba..8c23dc24f3 100644 --- a/packages/contentstack-branches/src/utils/entry-create-update-script.ts +++ b/packages/contentstack-branches/src/utils/entry-create-update-script.ts @@ -484,7 +484,9 @@ export function entryCreateUpdateScript(contentType) { .query({ query: { title: compareRefEntry.title } }) .find(); - updateValueByPath(entryDetails, references[i], baseRefEntry.items[0].uid); + if(baseRefEntry?.items?.length > 0 && baseRefEntry.items[0]?.uid){ + updateValueByPath(entryDetails, references[i], baseRefEntry.items[0].uid); + } } } } diff --git a/packages/contentstack-branches/src/utils/entry-update-script.ts b/packages/contentstack-branches/src/utils/entry-update-script.ts index 1ee65bff4a..d6021f5fe4 100644 --- a/packages/contentstack-branches/src/utils/entry-update-script.ts +++ b/packages/contentstack-branches/src/utils/entry-update-script.ts @@ -483,7 +483,9 @@ export function entryUpdateScript(contentType) { .query({ query: { title: compareRefEntry.title } }) .find(); - updateValueByPath(entryDetails, references[i], baseRefEntry.items[0].uid); + if(baseRefEntry?.items?.length > 0 && baseRefEntry.items[0]?.uid){ + updateValueByPath(entryDetails, references[i], baseRefEntry.items[0].uid); + } } } } diff --git a/packages/contentstack/package.json b/packages/contentstack/package.json index 2ecd4351e5..d57b858f75 100755 --- a/packages/contentstack/package.json +++ b/packages/contentstack/package.json @@ -37,7 +37,7 @@ "@contentstack/cli-migration": "~1.3.12", "@contentstack/cli-utilities": "~1.5.2", "@contentstack/management": "~1.10.0", - "@contentstack/cli-cm-branches": "~1.0.12", + "@contentstack/cli-cm-branches": "~1.0.13", "@oclif/plugin-help": "^5", "@oclif/plugin-not-found": "^2.4.0", "@oclif/plugin-plugins": "^3.3.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c1c5023597..df509b21ec 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,7 +12,7 @@ importers: specifiers: '@contentstack/cli-auth': ~1.3.13 '@contentstack/cli-cm-bootstrap': ~1.5.0 - '@contentstack/cli-cm-branches': ~1.0.12 + '@contentstack/cli-cm-branches': ~1.0.13 '@contentstack/cli-cm-bulk-publish': ~1.3.11 '@contentstack/cli-cm-clone': ~1.5.0 '@contentstack/cli-cm-export': ~1.9.0