File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
extensions/ql-vscode/src/pure Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 11import { pathExists , stat , readdir } from "fs-extra" ;
2- import { join , resolve } from "path" ;
2+ import { isAbsolute , join , relative , resolve } from "path" ;
33
44/**
55 * Recursively finds all .ql files in this set of Uris.
@@ -71,7 +71,13 @@ export function pathsEqual(path1: string, path2: string): boolean {
7171 * Returns true if `parent` contains `child`, or if they are equal.
7272 */
7373export function containsPath ( parent : string , child : string ) : boolean {
74- return normalizePath ( child ) . startsWith ( normalizePath ( parent ) ) ;
74+ const relativePath = relative ( parent , child ) ;
75+ return (
76+ ! relativePath . startsWith ( ".." ) &&
77+ // On windows, if the two paths are in different drives, then the
78+ // relative path will be an absolute path to the other drive.
79+ ! ( process . platform === "win32" && isAbsolute ( relativePath ) )
80+ ) ;
7581}
7682
7783export async function readDirFullPaths ( path : string ) : Promise < string [ ] > {
You can’t perform that action at this time.
0 commit comments