Skip to content

Commit

Permalink
fix: по идее окончательно пофиксил, проверим
Browse files Browse the repository at this point in the history
  • Loading branch information
artpani4 committed Jul 28, 2024
1 parent 1129e57 commit bab5747
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@artpani/tuner",
"version": "0.0.5",
"version": "0.0.6",
"exports": "./mod.ts",
"test": {
"files": {
Expand Down
9 changes: 5 additions & 4 deletions src/loaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ const configDir = <T extends ITunerConfig>(
): { fun: () => Promise<T>; args: string } => ({
fun: async (): Promise<T> => {
try {
const modulePath = resolve(path) + `?version=${Math.random()}`;
const module = await import(`file:///${modulePath}`);
const modulePath = 'file:///' + resolve(path) +
`?version=${Math.random()}`;
const module = await import(modulePath);
log.inf(
`Successfully loaded config from config directory: ${modulePath}`,
);
Expand All @@ -69,9 +70,9 @@ const cwd = <T extends ITunerConfig>(
): { fun: () => Promise<T>; args: string } => ({
fun: async (): Promise<T> => {
try {
const modulePath = resolve('./', path) +
const modulePath = 'file:///' + resolve('./', path) +
`?version=${Math.random()}`;
const module = await import(`file:///${modulePath}`);
const module = await import(modulePath);
log.inf(`Successfully loaded config from CWD: ${path}`);
return module.default as T;
} catch (error) {
Expand Down

0 comments on commit bab5747

Please sign in to comment.