Skip to content

Commit 0a34742

Browse files
authored
fix: normalize source cwd (#3532)
1 parent 63500f3 commit 0a34742

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/source.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { readFile } from 'node:fs/promises'
2-
import { join } from 'pathe'
2+
import { join, normalize } from 'pathe'
33
import { withLeadingSlash, withoutTrailingSlash } from 'ufo'
44
import { glob } from 'tinyglobby'
55
import type { CollectionSource, ResolvedCollectionSource } from '../types/collection'
@@ -25,7 +25,7 @@ export function defineLocalSource(source: CollectionSource | ResolvedCollectionS
2525
prefix: withoutTrailingSlash(withLeadingSlash(fixed)),
2626
prepare: async ({ rootDir }) => {
2727
resolvedSource.cwd = source.cwd
28-
? String(source.cwd).replace(/^~~\//, rootDir)
28+
? String(normalize(source.cwd)).replace(/^~~\//, rootDir)
2929
: join(rootDir, 'content')
3030
},
3131
getKeys: async () => {

0 commit comments

Comments
 (0)