mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -08:00
fix(cli): use absolute paths for loading custom nodes and credentials (#4099)
custom-node loading broke because of this change, as we started using relative paths for the files returned by `glob` #4082
This commit is contained in:
parent
a8127dfc05
commit
43c9f019bd
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -495,6 +495,7 @@ class LoadNodesAndCredentialsClass {
|
|||
async loadDataFromDirectory(setPackageName: string, directory: string): Promise<void> {
|
||||
const files = await glob('**/*.@(node|credentials).js', {
|
||||
cwd: directory,
|
||||
absolute: true,
|
||||
});
|
||||
|
||||
for (const filePath of files) {
|
||||
|
|
Loading…
Reference in a new issue