mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(core): Add windows support to import:credentials --separate (#3589)
This commit is contained in:
committed by
GitHub
parent
92b2caaf26
commit
2fb590e844
@@ -14,7 +14,6 @@ import { LoggerProxy } from 'n8n-workflow';
|
|||||||
|
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import glob from 'fast-glob';
|
import glob from 'fast-glob';
|
||||||
import path from 'path';
|
|
||||||
import { EntityManager, getConnection } from 'typeorm';
|
import { EntityManager, getConnection } from 'typeorm';
|
||||||
import { getLogger } from '../../src/Logger';
|
import { getLogger } from '../../src/Logger';
|
||||||
import { Db } from '../../src';
|
import { Db } from '../../src';
|
||||||
@@ -88,9 +87,15 @@ export class ImportCredentialsCommand extends Command {
|
|||||||
const encryptionKey = await UserSettings.getEncryptionKey();
|
const encryptionKey = await UserSettings.getEncryptionKey();
|
||||||
|
|
||||||
if (flags.separate) {
|
if (flags.separate) {
|
||||||
const files = await glob(
|
let { input: inputPath } = flags;
|
||||||
`${flags.input.endsWith(path.sep) ? flags.input : flags.input + path.sep}*.json`,
|
|
||||||
);
|
if (process.platform === 'win32') {
|
||||||
|
inputPath = inputPath.replace(/\\/g, '/');
|
||||||
|
}
|
||||||
|
|
||||||
|
inputPath = inputPath.replace(/\/$/g, '');
|
||||||
|
|
||||||
|
const files = await glob(`${inputPath}/*.json`);
|
||||||
|
|
||||||
totalImported = files.length;
|
totalImported = files.length;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user