mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
fix(cli): avoid scanning unnecessary directories on windows (#4082)
fixes #4007 Ticket: N8N-4603
This commit is contained in:
parent
dd2b55e352
commit
84b56eb48e
|
@ -95,7 +95,7 @@ export class ImportCredentialsCommand extends Command {
|
|||
|
||||
inputPath = inputPath.replace(/\/$/g, '');
|
||||
|
||||
const files = await glob(`${inputPath}/*.json`);
|
||||
const files = await glob('*.json', { cwd: inputPath });
|
||||
|
||||
totalImported = files.length;
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ export class ImportWorkflowsCommand extends Command {
|
|||
|
||||
inputPath = inputPath.replace(/\/$/g, '');
|
||||
|
||||
const files = await glob(`${inputPath}/*.json`);
|
||||
const files = await glob('*.json', { cwd: inputPath });
|
||||
|
||||
totalImported = files.length;
|
||||
|
||||
|
|
|
@ -493,7 +493,9 @@ class LoadNodesAndCredentialsClass {
|
|||
* @returns {Promise<void>}
|
||||
*/
|
||||
async loadDataFromDirectory(setPackageName: string, directory: string): Promise<void> {
|
||||
const files = await glob(path.join(directory, '**/*.@(node|credentials).js'));
|
||||
const files = await glob('**/*.@(node|credentials).js', {
|
||||
cwd: directory,
|
||||
});
|
||||
|
||||
for (const filePath of files) {
|
||||
const [fileName, type] = path.parse(filePath).name.split('.');
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { IExecuteFunctions } from 'n8n-core';
|
||||
import { INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
||||
import glob from 'fast-glob';
|
||||
import path from 'path';
|
||||
|
||||
import { readFile as fsReadFile } from 'fs/promises';
|
||||
|
||||
|
|
Loading…
Reference in a new issue