Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/contentstack-bulk-publish/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-bulk-publish",
"description": "Contentstack CLI plugin for bulk publish actions",
"version": "1.10.0",
"version": "1.10.1",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,16 @@ class PublishEntriesCommand extends Command {
updatedFlags.environment = updatedFlags['source-env'];
updatedFlags.onlyEntries = true;
if (updatedFlags.locales instanceof Array) {
updatedFlags.locales.forEach((locale) => {
for (const locale of updatedFlags.locales) {
updatedFlags.locale = locale;
publishFunction(startCrossPublish);
});
await publishFunction(startCrossPublish);
}
} else {
updatedFlags.locale = locales;
publishFunction(startCrossPublish);
updatedFlags.locale = updatedFlags.locales;
await publishFunction(startCrossPublish);
}
} else {
publishFunction(startPublish);
await publishFunction(startPublish);
}
} catch (error) {
let message = formatError(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/* eslint-disable camelcase */
/* eslint-disable complexity */
/* eslint-disable max-params */
const chalk = require('chalk');
const { configHandler, cliux } = require('@contentstack/cli-utilities');
const { getQueue } = require('../util/queue');
const { performBulkPublish, publishEntry, publishAsset, initializeLogger } = require('../consumer/publish');
Expand All @@ -13,7 +14,7 @@ const entryQueue = getQueue();
const assetQueue = getQueue();
const { Command } = require('@contentstack/cli-command');
const command = new Command();
const { isEmpty } = require('../util');
const { isEmpty, formatError } = require('../util');
const { fetchBulkPublishLimit } = require('../util/common-utility');
const { generateBulkPublishStatusUrl } = require('../util/generate-bulk-publish-url');
const VARIANTS_PUBLISH_API_VERSION = '3.2';
Expand Down Expand Up @@ -204,7 +205,13 @@ async function getSyncEntries(
syncData['type'] = queryParamsObj.type;
}

const entriesResponse = await Stack.sync(syncData);
let entriesResponse;
try {
entriesResponse = await Stack.sync(syncData);
} catch (syncError) {
console.log(chalk.red(`Failed to sync from environment '${queryParamsObj.environment}' with error ${formatError(syncError)}`));
return reject(syncError);
}

if (filter?.content_type_uid?.length) {
entriesResponse.items = entriesResponse.items.filter((entry) =>
Expand Down Expand Up @@ -241,6 +248,7 @@ async function getSyncEntries(
destEnv,
apiVersion,
bulkPublishLimit,
variantsFlag,
entriesResponse.pagination_token,
);
}, 3000);
Expand Down
11 changes: 9 additions & 2 deletions packages/contentstack-bulk-publish/src/producer/unpublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/* eslint-disable complexity */
/* eslint-disable no-console */
/* eslint-disable camelcase */
const chalk = require('chalk');
const { configHandler, cliux } = require('@contentstack/cli-utilities');
const { getQueue } = require('../util/queue');
const { performBulkUnPublish, UnpublishEntry, UnpublishAsset, initializeLogger } = require('../consumer/publish');
Expand All @@ -13,7 +14,7 @@ const entryQueue = getQueue();
const assetQueue = getQueue();
const { Command } = require('@contentstack/cli-command');
const command = new Command();
const { isEmpty } = require('../util');
const { isEmpty, formatError } = require('../util');
const { fetchBulkPublishLimit } = require('../util/common-utility');
const { generateBulkPublishStatusUrl } = require('../util/generate-bulk-publish-url');
const VARIANTS_UNPUBLISH_API_VERSION = '3.2';
Expand Down Expand Up @@ -217,7 +218,13 @@ async function getSyncEntries(
syncData['content_type_uid'] = queryParamsObj.content_type_uid;
}

const entriesResponse = await Stack.sync(syncData);
let entriesResponse;
try {
entriesResponse = await Stack.sync(syncData);
} catch (syncError) {
console.log(chalk.red(`Failed to sync from environment '${queryParamsObj.environment}' with error ${formatError(syncError)}`));
return reject(syncError);
}
if (entriesResponse.items.length > 0) {
if (variantsFlag) {
queryParamsObj.apiVersion = VARIANTS_UNPUBLISH_API_VERSION;
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@contentstack/cli-auth": "~1.6.1",
"@contentstack/cli-cm-bootstrap": "~1.16.1",
"@contentstack/cli-cm-branches": "~1.6.0",
"@contentstack/cli-cm-bulk-publish": "~1.10.0",
"@contentstack/cli-cm-bulk-publish": "~1.10.1",
"@contentstack/cli-cm-clone": "~1.16.1",
"@contentstack/cli-cm-export": "~1.20.1",
"@contentstack/cli-cm-export-to-csv": "~1.9.1",
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading