mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 19:32:15 +00:00
fix(cli): load nodes and credentials on windows using the correct file-path (#4084)
This commit is contained in:
committed by
GitHub
parent
3de0e228cb
commit
b6c1187922
@@ -238,6 +238,9 @@ export function isNpmError(error: unknown): error is { code: number; stdout: str
|
|||||||
|
|
||||||
const context = createContext({ require });
|
const context = createContext({ require });
|
||||||
export const loadClassInIsolation = (filePath: string, className: string) => {
|
export const loadClassInIsolation = (filePath: string, className: string) => {
|
||||||
|
if (process.platform === 'win32') {
|
||||||
|
filePath = filePath.replace(/\\/g, '/');
|
||||||
|
}
|
||||||
const script = new Script(`new (require('${filePath}').${className})()`);
|
const script = new Script(`new (require('${filePath}').${className})()`);
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
||||||
return script.runInContext(context);
|
return script.runInContext(context);
|
||||||
|
|||||||
Reference in New Issue
Block a user