mirror of
https://github.com/strapi/strapi.git
synced 2025-10-16 10:33:34 +00:00
Only register the transfer command when STRAPI_EXPERIMENTAL is enabled
This commit is contained in:
parent
1ebbc5f504
commit
9f24e5cf18
@ -258,22 +258,24 @@ program
|
||||
.option('-s, --silent', `Run the generation silently, without any output`, false)
|
||||
.action(getLocalScript('ts/generate-types'));
|
||||
|
||||
// `$ strapi transfer`
|
||||
program
|
||||
.command('transfer')
|
||||
.description('Transfer data from one source to another')
|
||||
.addOption(new Option('--from <sourceURL>', `URL of remote Strapi instance to get data from.`))
|
||||
.addOption(new Option('--to <destinationURL>', `URL of remote Strapi instance to send data to`))
|
||||
.hook('preAction', async (thisCommand) => {
|
||||
const opts = thisCommand.opts();
|
||||
if (process.env.STRAPI_EXPERIMENTAL) {
|
||||
// `$ strapi transfer`
|
||||
program
|
||||
.command('transfer')
|
||||
.description('Transfer data from one source to another')
|
||||
.addOption(new Option('--from <sourceURL>', `URL of remote Strapi instance to get data from.`))
|
||||
.addOption(new Option('--to <destinationURL>', `URL of remote Strapi instance to send data to`))
|
||||
.hook('preAction', async (thisCommand) => {
|
||||
const opts = thisCommand.opts();
|
||||
|
||||
if (!opts.from && !opts.to) {
|
||||
console.error('At least one source (from) or destination (to) option must be provided');
|
||||
process.exit(1);
|
||||
}
|
||||
})
|
||||
.allowExcessArguments(false)
|
||||
.action(getLocalScript('transfer/transfer'));
|
||||
if (!opts.from && !opts.to) {
|
||||
console.error('At least one source (from) or destination (to) option must be provided');
|
||||
process.exit(1);
|
||||
}
|
||||
})
|
||||
.allowExcessArguments(false)
|
||||
.action(getLocalScript('transfer/transfer'));
|
||||
}
|
||||
|
||||
// `$ strapi export`
|
||||
program
|
||||
|
Loading…
x
Reference in New Issue
Block a user