mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
⚡ Improve CLI export/import and add missing files
This commit is contained in:
@@ -22,6 +22,7 @@ export class ExportCredentialsCommand extends Command {
|
||||
`$ n8n export:credentials --all`,
|
||||
`$ n8n export:credentials --id=5 --output=file.json`,
|
||||
`$ n8n export:credentials --all --output=backups/latest/`,
|
||||
`$ n8n export:credentials --backup --output=backups/latest/`,
|
||||
];
|
||||
|
||||
static flags = {
|
||||
@@ -29,10 +30,14 @@ export class ExportCredentialsCommand extends Command {
|
||||
all: flags.boolean({
|
||||
description: 'Export all credentials',
|
||||
}),
|
||||
backup: flags.boolean({
|
||||
description: 'Sets --all --pretty --separate for simple backups. Only --output has to be set additionally.',
|
||||
}),
|
||||
id: flags.string({
|
||||
description: 'The ID of the credential to export',
|
||||
}),
|
||||
output: flags.string({
|
||||
char: 'o',
|
||||
description: 'Output file name or directory if using separate files',
|
||||
}),
|
||||
pretty: flags.boolean({
|
||||
@@ -46,6 +51,12 @@ export class ExportCredentialsCommand extends Command {
|
||||
async run() {
|
||||
const { flags } = this.parse(ExportCredentialsCommand);
|
||||
|
||||
if (flags.backup) {
|
||||
flags.all = true;
|
||||
flags.pretty = true;
|
||||
flags.separate = true;
|
||||
}
|
||||
|
||||
if (!flags.all && !flags.id) {
|
||||
GenericHelpers.logOutput(`Either option "--all" or "--id" have to be set!`);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user