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:
कारतोफ्फेलस्क्रिप्ट™ 2022-09-14 10:37:51 +02:00 committed by GitHub
parent a8127dfc05
commit 43c9f019bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 6 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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) {