Skip to content

Commit aa7cdd2

Browse files
authored
Fix glob escape characters not working (#269)
1 parent 27135c2 commit aa7cdd2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/lib/glob.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ export const count: (glob: string | string[]) => number = (glob: string | string
4848
for(const g of (Array.isArray(glob) ? glob.filter(unique) : [glob]))
4949
if(g.startsWith("https://"))
5050
i++;
51-
else // need to normalize '/' ↓ so glob works properly
52-
globs.push(resolveEnv(g).replace(/\\/g, '/'));
51+
else // do not normalize '/', add file/dir already does this; warning already included in add glob
52+
globs.push(resolveEnv(g));
5353

5454
return i + (globSync(globs, options) as string[]).filter(filter).filter(unique).length;
5555
}
@@ -61,11 +61,11 @@ export const resolve: (glob: string | string[]) => string[] = (glob: string | st
6161
for(const g of (Array.isArray(glob) ? glob.filter(unique) : [glob]))
6262
if(g.startsWith("https://"))
6363
urls.push(g);
64-
else // need to normalize '/' ↓ so glob works properly
65-
globs.push(resolveEnv(g).replace(/\\/g, '/'));
64+
else // do not normalize '/', add file/dir already does this; warning already included in add glob
65+
globs.push(resolveEnv(g));
6666

6767
return urls.concat((globSync(globs, options) as string[])
68-
.filter(filter) // need to normalize '/' again ↓ because glob uses the wrong slash
68+
.filter(filter) // must use '/' for URL ↓
6969
.map(path => `vscode-file://vscode-app/${path.replace(/\\/g, '/').replace(/^\/+/g, "")}`))
7070
.filter(unique)
7171
.map(path => '"' + path + '"');
File renamed without changes.

0 commit comments

Comments
 (0)