diff --git a/packages/cli/commands/import/credentials.ts b/packages/cli/commands/import/credentials.ts index 9a0170ba59285..a1fec6b000719 100644 --- a/packages/cli/commands/import/credentials.ts +++ b/packages/cli/commands/import/credentials.ts @@ -93,9 +93,10 @@ export class ImportCredentialsCommand extends Command { inputPath = inputPath.replace(/\\/g, '/'); } - inputPath = inputPath.replace(/\/$/g, ''); - - const files = await glob('*.json', { cwd: inputPath }); + const files = await glob('*.json', { + cwd: inputPath, + absolute: true, + }); totalImported = files.length; diff --git a/packages/cli/commands/import/workflow.ts b/packages/cli/commands/import/workflow.ts index 5b08a4d0ed035..b365829b13e89 100644 --- a/packages/cli/commands/import/workflow.ts +++ b/packages/cli/commands/import/workflow.ts @@ -115,9 +115,10 @@ export class ImportWorkflowsCommand extends Command { inputPath = inputPath.replace(/\\/g, '/'); } - inputPath = inputPath.replace(/\/$/g, ''); - - const files = await glob('*.json', { cwd: inputPath }); + const files = await glob('*.json', { + cwd: inputPath, + absolute: true, + }); totalImported = files.length; diff --git a/packages/cli/src/LoadNodesAndCredentials.ts b/packages/cli/src/LoadNodesAndCredentials.ts index 7062aad8b05eb..f75f289d99743 100644 --- a/packages/cli/src/LoadNodesAndCredentials.ts +++ b/packages/cli/src/LoadNodesAndCredentials.ts @@ -495,6 +495,7 @@ class LoadNodesAndCredentialsClass { async loadDataFromDirectory(setPackageName: string, directory: string): Promise { const files = await glob('**/*.@(node|credentials).js', { cwd: directory, + absolute: true, }); for (const filePath of files) {