Skip to content

Commit 389ecc5

Browse files
committed
[Docs] Fix component/partial usage on Windows
1 parent 890bb7b commit 389ecc5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/util/components.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ export async function getComponentsUsage(
3333
);
3434

3535
for (const file of files) {
36-
const fullName = file.parentPath + "/" + file.name;
36+
const parentPath =
37+
process.platform === "win32"
38+
? file.parentPath.replaceAll("\\", "/")
39+
: file.parentPath;
40+
const fullName = parentPath + "/" + file.name;
3741
const content = await readFile(fullName, "utf8");
3842

3943
if (!content.includes("import")) continue;
@@ -85,7 +89,11 @@ export async function getPartialsUsage(): Promise<Record<string, Usage>> {
8589
);
8690

8791
for (const file of files) {
88-
const fullName = file.parentPath + "/" + file.name;
92+
const parentPath =
93+
process.platform === "win32"
94+
? file.parentPath.replaceAll("\\", "/")
95+
: file.parentPath;
96+
const fullName = parentPath + "/" + file.name;
8997
const content = await readFile(fullName, "utf8");
9098

9199
if (!content.includes("import")) continue;

0 commit comments

Comments
 (0)