Skip to content

Commit b651014

Browse files
authored
fix(ci): convert Windows absolute paths to file URLs for dynamic imports
The dynamic import in `importAlterationScript` was failing on Windows because it used an absolute file path without converting it to a valid file URL.
1 parent b2abf05 commit b651014

File tree

1 file changed

+2
-1
lines changed
  • packages/cli/src/commands/database/alteration

1 file changed

+2
-1
lines changed

packages/cli/src/commands/database/alteration/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ import {
1818
chooseRevertAlterationsByTimestamp,
1919
} from './utils.js';
2020
import { chooseAlterationsByVersion, chooseRevertAlterationsByVersion } from './version.js';
21+
import { pathToFileURL } from 'url';
2122

2223
const importAlterationScript = async (filePath: string): Promise<AlterationScript> => {
2324
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
24-
const module = await import(filePath);
25+
const module = await import(pathToFileURL(filePath).href);
2526

2627
// eslint-disable-next-line no-restricted-syntax
2728
return module.default as AlterationScript;

0 commit comments

Comments
 (0)