diff --git a/packages/cli/commands/import/credentials.ts b/packages/cli/commands/import/credentials.ts index e405d1d5c..da6453a65 100644 --- a/packages/cli/commands/import/credentials.ts +++ b/packages/cli/commands/import/credentials.ts @@ -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;