Skip to content

Commit c2a4036

Browse files
authored
fix: use import.meta.url to define __dirname (#642)
1 parent c31ce90 commit c2a4036

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/nevermore-cli/src/utils/nevermore-cli-utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ import * as path from 'path';
22
import { OutputHelper } from '@quenty/cli-output-helpers';
33
import { NevermoreGlobalArgs } from '../args/global-args.js';
44
import { execa, Options } from 'execa';
5+
import { fileURLToPath } from 'url';
56

67
/**
78
* Gets a temlate path by name
89
* @param name
910
* @returns
1011
*/
1112
export function getTemplatePathByName(name: string) {
12-
return path.join(__dirname, '..', '..', 'templates', name);
13+
return path.join(path.dirname(fileURLToPath(import.meta.url)), '..', '..', 'templates', name);
1314
}
1415

1516
export async function runCommandAsync(

0 commit comments

Comments
 (0)