fix: path handling inconsistencies (#2482)
This commit is contained in:
+6
-2
@@ -39,9 +39,11 @@ export interface ResolvedFreshConfig {
|
||||
mode: Mode;
|
||||
}
|
||||
|
||||
export function parseRootPath(root: string): string {
|
||||
export function parseRootPath(root: string, cwd: string): string {
|
||||
if (root.startsWith("file://")) {
|
||||
root = path.fromFileUrl(root);
|
||||
} else if (!path.isAbsolute(root)) {
|
||||
root = path.join(cwd, root);
|
||||
}
|
||||
|
||||
const ext = path.extname(root);
|
||||
@@ -56,7 +58,9 @@ export function parseRootPath(root: string): string {
|
||||
}
|
||||
|
||||
export function normalizeConfig(options: FreshConfig): ResolvedFreshConfig {
|
||||
const root = options.root ? parseRootPath(options.root) : Deno.cwd();
|
||||
const root = options.root
|
||||
? parseRootPath(options.root, Deno.cwd())
|
||||
: Deno.cwd();
|
||||
|
||||
return {
|
||||
root,
|
||||
|
||||
Reference in New Issue
Block a user