From ce32a52f045b0de415c87aafef81c40bf3d38bb3 Mon Sep 17 00:00:00 2001 From: Antony Date: Wed, 3 Jan 2024 13:34:12 +0530 Subject: [PATCH] Feat: Audit fix command integration with Import --- package-lock.json | 4 ++-- packages/contentstack-clone/package.json | 2 +- packages/contentstack-clone/src/commands/cm/stacks/clone.js | 4 ++++ packages/contentstack-clone/src/lib/util/clone-handler.js | 2 ++ packages/contentstack/package.json | 2 +- pnpm-lock.yaml | 2 +- 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index afcc36529a..03e1b54b44 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23498,7 +23498,7 @@ "@contentstack/cli-cm-bootstrap": "~1.7.1", "@contentstack/cli-cm-branches": "~1.0.19", "@contentstack/cli-cm-bulk-publish": "~1.4.0", - "@contentstack/cli-cm-clone": "~1.8.0", + "@contentstack/cli-cm-clone": "~1.9.0", "@contentstack/cli-cm-export": "~1.10.2", "@contentstack/cli-cm-export-to-csv": "~1.6.2", "@contentstack/cli-cm-import": "~1.12.3", @@ -24049,7 +24049,7 @@ }, "packages/contentstack-clone": { "name": "@contentstack/cli-cm-clone", - "version": "1.8.0", + "version": "1.9.0", "license": "MIT", "dependencies": { "@colors/colors": "^1.5.0", diff --git a/packages/contentstack-clone/package.json b/packages/contentstack-clone/package.json index 19b9284a46..c0c0a1a8aa 100644 --- a/packages/contentstack-clone/package.json +++ b/packages/contentstack-clone/package.json @@ -1,7 +1,7 @@ { "name": "@contentstack/cli-cm-clone", "description": "Contentstack stack clone plugin", - "version": "1.8.0", + "version": "1.9.0", "author": "Contentstack", "bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues", "dependencies": { diff --git a/packages/contentstack-clone/src/commands/cm/stacks/clone.js b/packages/contentstack-clone/src/commands/cm/stacks/clone.js index 12542e2cf8..6f0e1d8766 100644 --- a/packages/contentstack-clone/src/commands/cm/stacks/clone.js +++ b/packages/contentstack-clone/src/commands/cm/stacks/clone.js @@ -29,6 +29,7 @@ class StackCloneCommand extends Command { const listOfTokens = configHandler.get('tokens'); config.forceStopMarketplaceAppsPrompt = yes; + config.skipAudit = cloneCommandFlags['skip-audit']; if (cloneType) { config.cloneType = cloneType; @@ -245,6 +246,9 @@ b) Structure with content (all modules including entries & assets) required: false, description: '[Optional] Override marketplace prompts', }), + 'skip-audit': flags.boolean({ + description: 'Skips the audit fix.', + }), }; StackCloneCommand.usage = diff --git a/packages/contentstack-clone/src/lib/util/clone-handler.js b/packages/contentstack-clone/src/lib/util/clone-handler.js index c594827c46..e471e29b26 100644 --- a/packages/contentstack-clone/src/lib/util/clone-handler.js +++ b/packages/contentstack-clone/src/lib/util/clone-handler.js @@ -655,6 +655,8 @@ class CloneHandler { cmd.push('--import-webhook-status', config.importWebhookStatus); } + if (config.skipAudit) cmd.push('--skip-audit'); + if (config.forceStopMarketplaceAppsPrompt) cmd.push('-y'); fs.writeFileSync(path.join(__dirname, 'dummyConfig.json'), JSON.stringify(config)); diff --git a/packages/contentstack/package.json b/packages/contentstack/package.json index 39d8d92e3b..483af2ccce 100755 --- a/packages/contentstack/package.json +++ b/packages/contentstack/package.json @@ -27,7 +27,7 @@ "@contentstack/cli-cm-bootstrap": "~1.7.1", "@contentstack/cli-cm-branches": "~1.0.19", "@contentstack/cli-cm-bulk-publish": "~1.4.0", - "@contentstack/cli-cm-clone": "~1.8.0", + "@contentstack/cli-cm-clone": "~1.9.0", "@contentstack/cli-cm-export": "~1.10.2", "@contentstack/cli-cm-export-to-csv": "~1.6.2", "@contentstack/cli-cm-import": "~1.12.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 93204029b3..bc78ccfcfc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,7 +15,7 @@ importers: '@contentstack/cli-cm-bootstrap': ~1.7.1 '@contentstack/cli-cm-branches': ~1.0.19 '@contentstack/cli-cm-bulk-publish': ~1.4.0 - '@contentstack/cli-cm-clone': ~1.8.0 + '@contentstack/cli-cm-clone': ~1.9.0 '@contentstack/cli-cm-export': ~1.10.2 '@contentstack/cli-cm-export-to-csv': ~1.6.2 '@contentstack/cli-cm-import': ~1.12.3