Skip to content

Commit aefc561

Browse files
authored
Merge pull request #249 from devforth/AdminForth/692
fix: normalize file paths for compatibility on Windows
2 parents 21c1abb + 0b64d80 commit aefc561

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

adminforth/commands/cli.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import createResource from "./createResource/main.js";
1212
import chalk from "chalk";
1313
import path from "path";
1414
import fs from "fs";
15+
import { fileURLToPath } from 'url';
1516

1617
function showHelp() {
1718
console.log(
@@ -26,7 +27,7 @@ function showHelp() {
2627
}
2728

2829
export function currentFileDir(importMetaUrl) {
29-
const filePath = importMetaUrl.replace("file://", "");
30+
const filePath = fileURLToPath(importMetaUrl);
3031
const fileDir = path.dirname(filePath);
3132
return fileDir;
3233
}

0 commit comments

Comments
 (0)