Skip to content

Commit

Permalink
Don't match on prefix alone (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
heyimalex authored Mar 7, 2024
1 parent 4644010 commit 7c9d48e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/common/isFileOnPath.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import path from 'path';
import { getPosixFilePath } from './utils';
import { getAbsolutePath } from './getAbsolutePath';
import { getProjectPathFromArgs } from './utils';
Expand All @@ -19,5 +20,7 @@ export function isFileOnPath({

const absolutePathToStrictFiles = getAbsolutePath(projectPath, targetPath);

return getPosixFilePath(filePath).startsWith(getPosixFilePath(absolutePathToStrictFiles));
return getPosixFilePath(filePath).startsWith(
getPosixFilePath(absolutePathToStrictFiles) + path.posix.sep,
);
}

0 comments on commit 7c9d48e

Please sign in to comment.