mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +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 glob from 'fast-glob';
|
||||
import path from 'path';
|
||||
import { EntityManager, getConnection } from 'typeorm';
|
||||
import { getLogger } from '../../src/Logger';
|
||||
import { Db } from '../../src';
|
||||
@@ -88,9 +87,15 @@ export class ImportCredentialsCommand extends Command {
|
||||
const encryptionKey = await UserSettings.getEncryptionKey();
|
||||
|
||||
if (flags.separate) {
|
||||
const files = await glob(
|
||||
`${flags.input.endsWith(path.sep) ? flags.input : flags.input + path.sep}*.json`,
|
||||
);
|
||||
let { input: inputPath } = flags;
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
inputPath = inputPath.replace(/\\/g, '/');
|
||||
}
|
||||
|
||||
inputPath = inputPath.replace(/\/$/g, '');
|
||||
|
||||
const files = await glob(`${inputPath}/*.json`);
|
||||
|
||||
totalImported = files.length;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user