use string concat instead of path.join
This commit is contained in:
parent
ef6d53071b
commit
4d5423294a
1 changed files with 7 additions and 4 deletions
|
|
@ -77,18 +77,21 @@ function getGlobPattern(
|
|||
if (id.uriType !== "file") {
|
||||
return globs;
|
||||
}
|
||||
const dir = path.dirname(id.filePath);
|
||||
let dir = path.dirname(id.filePath);
|
||||
if (dir.includes(".continue")) {
|
||||
return globs;
|
||||
}
|
||||
if (!dir.endsWith("/")) {
|
||||
dir = dir.concat("/");
|
||||
}
|
||||
const prependDirAndApplyGlobstar = (glob: string) => {
|
||||
if (glob.startsWith("**")) {
|
||||
return path.join(dir, glob);
|
||||
return dir.concat(glob);
|
||||
}
|
||||
return path.join(dir, `**/${glob}`);
|
||||
return dir.concat("**/", glob);
|
||||
};
|
||||
if (!globs) {
|
||||
return path.join(dir, "**/*");
|
||||
return dir.concat("**/*");
|
||||
}
|
||||
if (Array.isArray(globs)) {
|
||||
return globs.map(prependDirAndApplyGlobstar);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue