Skip to content

Commit 4d54232

Browse files
committed
use string concat instead of path.join
1 parent ef6d530 commit 4d54232

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/config-yaml/src/markdown/markdownToRule.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,21 @@ function getGlobPattern(
7777
if (id.uriType !== "file") {
7878
return globs;
7979
}
80-
const dir = path.dirname(id.filePath);
80+
let dir = path.dirname(id.filePath);
8181
if (dir.includes(".continue")) {
8282
return globs;
8383
}
84+
if (!dir.endsWith("/")) {
85+
dir = dir.concat("/");
86+
}
8487
const prependDirAndApplyGlobstar = (glob: string) => {
8588
if (glob.startsWith("**")) {
86-
return path.join(dir, glob);
89+
return dir.concat(glob);
8790
}
88-
return path.join(dir, `**/${glob}`);
91+
return dir.concat("**/", glob);
8992
};
9093
if (!globs) {
91-
return path.join(dir, "**/*");
94+
return dir.concat("**/*");
9295
}
9396
if (Array.isArray(globs)) {
9497
return globs.map(prependDirAndApplyGlobstar);

0 commit comments

Comments
 (0)