Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

specific content type export flag fix #1279

Merged
merged 9 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
2 changes: 1 addition & 1 deletion packages/contentstack-export/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-export",
"description": "Contentstack CLI plugin to export content from stack",
"version": "1.10.4",
"version": "1.10.5",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,12 @@ export default class ExportCommand extends Command {
module: flags.string({
char: 'm',
description: '[optional] specific module name',
exclusive: ['content-types'],
parse: printFlagDeprecation(['-m'], ['--module']),
}),
'content-types': flags.string({
char: 't',
description: '[optional] content type',
multiple: true,
exclusive: ['module'],
parse: printFlagDeprecation(['-t'], ['--content-types']),
}),
branch: flags.string({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ContentTypesExport {
include_global_field_schema: true,
};
// If content type id is provided then use it as part of query
if (Array.isArray(this.exportConfig.contentTypes) && this.exportConfig.length > 0) {
if (Array.isArray(this.exportConfig.contentTypes) && this.exportConfig.contentTypes.length > 0) {
this.qs.uid = { $in: this.exportConfig.contentTypes };
}
this.contentTypesPath = path.resolve(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default class ContentTypesExport extends BaseClass {
skip?: number;
limit?: number;
include_global_field_schema: boolean;
uid?: Record<string, string[]>
};
private contentTypesConfig: {
dirName?: string;
Expand All @@ -35,6 +36,12 @@ export default class ContentTypesExport extends BaseClass {
limit: this.contentTypesConfig.limit,
include_global_field_schema: true,
};

// If content type id is provided then use it as part of query
if (Array.isArray(this.exportConfig.contentTypes) && this.exportConfig.contentTypes.length > 0) {
this.qs.uid = { $in: this.exportConfig.contentTypes };
}

this.contentTypesDirPath = path.resolve(
exportConfig.data,
exportConfig.branchName || '',
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli",
"description": "Command-line tool (CLI) to interact with Contentstack",
"version": "1.13.0",
"version": "1.13.1",
shafeeqd959 marked this conversation as resolved.
Show resolved Hide resolved
"author": "Contentstack",
"bin": {
"csdx": "./bin/run"
Expand All @@ -28,7 +28,7 @@
"@contentstack/cli-cm-branches": "~1.0.22",
"@contentstack/cli-cm-bulk-publish": "~1.4.0",
"@contentstack/cli-cm-clone": "~1.9.0",
"@contentstack/cli-cm-export": "~1.10.4",
"@contentstack/cli-cm-export": "~1.10.5",
"@contentstack/cli-cm-export-to-csv": "~1.6.2",
"@contentstack/cli-cm-import": "~1.13.2",
"@contentstack/cli-cm-migrate-rte": "~1.4.15",
Expand Down
Loading