Skip to content

Commit

Permalink
[ci] (fix): linux compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
LoboMetalurgico committed Jul 27, 2023
1 parent ec1b293 commit 5f888fa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/tests/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,13 @@ async function run(): Promise<void> {
return logger.fatal('No Tests found!');
}

const isWin = process.platform === 'win32';

for await (const file of jsfiles) {
const pathUrl = new URL(`${scriptDir}/${file}`, import.meta.url).toString();
const fileUrl = url.pathToFileURL(pathUrl);
const eventFunction = await import(fileUrl.toString());
const fileUrl = url.pathToFileURL(pathUrl).toString();
const finalUrl = isWin ? fileUrl : pathUrl;
const eventFunction = await import(finalUrl);
logger.info(`=> ${chalk.blueBright(eventFunction.name)}`);
tests.push(eventFunction);
}
Expand Down

0 comments on commit 5f888fa

Please sign in to comment.