mirror of
https://github.com/strapi/strapi.git
synced 2025-10-17 02:53:22 +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)
|
.option('-s, --silent', `Run the generation silently, without any output`, false)
|
||||||
.action(getLocalScript('ts/generate-types'));
|
.action(getLocalScript('ts/generate-types'));
|
||||||
|
|
||||||
// `$ strapi transfer`
|
if (process.env.STRAPI_EXPERIMENTAL) {
|
||||||
program
|
// `$ strapi transfer`
|
||||||
.command('transfer')
|
program
|
||||||
.description('Transfer data from one source to another')
|
.command('transfer')
|
||||||
.addOption(new Option('--from <sourceURL>', `URL of remote Strapi instance to get data from.`))
|
.description('Transfer data from one source to another')
|
||||||
.addOption(new Option('--to <destinationURL>', `URL of remote Strapi instance to send data to`))
|
.addOption(new Option('--from <sourceURL>', `URL of remote Strapi instance to get data from.`))
|
||||||
.hook('preAction', async (thisCommand) => {
|
.addOption(new Option('--to <destinationURL>', `URL of remote Strapi instance to send data to`))
|
||||||
const opts = thisCommand.opts();
|
.hook('preAction', async (thisCommand) => {
|
||||||
|
const opts = thisCommand.opts();
|
||||||
|
|
||||||
if (!opts.from && !opts.to) {
|
if (!opts.from && !opts.to) {
|
||||||
console.error('At least one source (from) or destination (to) option must be provided');
|
console.error('At least one source (from) or destination (to) option must be provided');
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.allowExcessArguments(false)
|
.allowExcessArguments(false)
|
||||||
.action(getLocalScript('transfer/transfer'));
|
.action(getLocalScript('transfer/transfer'));
|
||||||
|
}
|
||||||
|
|
||||||
// `$ strapi export`
|
// `$ strapi export`
|
||||||
program
|
program
|
||||||
|
Loading…
x
Reference in New Issue
Block a user