From 4e600751952171fc5c8afbab8fce70a34a635fb0 Mon Sep 17 00:00:00 2001 From: Jaka Purg Date: Mon, 23 Sep 2024 14:43:08 +0200 Subject: [PATCH] Fixed version setting for scripts with same name --- src/migrations.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/migrations.ts b/src/migrations.ts index 9f11a8a..f936c50 100644 --- a/src/migrations.ts +++ b/src/migrations.ts @@ -250,9 +250,9 @@ export class Migration { fileArr.forEach((file) => { let script; try { - script = module.parent.parent.require( + script = {...module.parent.parent.require( path.resolve(process.cwd(), dirPath, file) - ); + )}; } catch (e) { this.writeLog(`Unable to load script from ${file}! (${e})`); // typescript/javascript file are expected to load successfully from folder