Skip to content

Commit 7c9d48e

Browse files
authored
Don't match on prefix alone (#68)
1 parent 4644010 commit 7c9d48e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/common/isFileOnPath.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import path from 'path';
12
import { getPosixFilePath } from './utils';
23
import { getAbsolutePath } from './getAbsolutePath';
34
import { getProjectPathFromArgs } from './utils';
@@ -19,5 +20,7 @@ export function isFileOnPath({
1920

2021
const absolutePathToStrictFiles = getAbsolutePath(projectPath, targetPath);
2122

22-
return getPosixFilePath(filePath).startsWith(getPosixFilePath(absolutePathToStrictFiles));
23+
return getPosixFilePath(filePath).startsWith(
24+
getPosixFilePath(absolutePathToStrictFiles) + path.posix.sep,
25+
);
2326
}

0 commit comments

Comments
 (0)