Merge branch 'features/deits' into deits/cli-exclude-only

This commit is contained in:
Ben Irvin 2023-01-17 10:39:23 +01:00 committed by GitHub
commit bf9e5ca345
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

10
packages/core/strapi/bin/strapi.js Executable file → Normal file
View File

@ -21,7 +21,7 @@ const {
forceOption, forceOption,
} = require('../lib/commands/utils/commander'); } = require('../lib/commands/utils/commander');
const { ifOptions, assertUrlHasProtocol, exitWith } = require('../lib/commands/utils/helpers'); const { ifOptions, assertUrlHasProtocol, exitWith } = require('../lib/commands/utils/helpers');
const { excludeOption, onlyOption } = require('../lib/commands/transfer/utils'); const { excludeOption, forceOption, onlyOption } = require('../lib/commands/transfer/utils');
const checkCwdIsStrapiApp = (name) => { const checkCwdIsStrapiApp = (name) => {
const logErrorAndExit = () => { const logErrorAndExit = () => {
@ -282,6 +282,7 @@ if (process.env.STRAPI_EXPERIMENTAL === 'true') {
`URL of the remote Strapi instance to send data to` `URL of the remote Strapi instance to send data to`
).argParser(parseURL) ).argParser(parseURL)
) )
.addOption(forceOption)
// Validate URLs // Validate URLs
.hook( .hook(
'preAction', 'preAction',
@ -304,8 +305,15 @@ if (process.env.STRAPI_EXPERIMENTAL === 'true') {
() => exitWith(1, 'At least one source (from) or destination (to) option must be provided') () => exitWith(1, 'At least one source (from) or destination (to) option must be provided')
) )
) )
.addOption(forceOption)
.addOption(excludeOption) .addOption(excludeOption)
.addOption(onlyOption) .addOption(onlyOption)
.hook(
'preAction',
confirmMessage(
'The import will delete all data in the remote database. Are you sure you want to proceed?'
)
)
.allowExcessArguments(false) .allowExcessArguments(false)
.action(getLocalScript('transfer/transfer')); .action(getLocalScript('transfer/transfer'));
} }