diff --git a/packages/cli/commands/import/credentials.ts b/packages/cli/commands/import/credentials.ts index 8405379c49169a..fe5bf7adbd519f 100644 --- a/packages/cli/commands/import/credentials.ts +++ b/packages/cli/commands/import/credentials.ts @@ -13,7 +13,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'; @@ -87,9 +86,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;