Open maxpatiiuk opened 1 week ago
Also, it seems like .gitignore
patterns like /.git/**
and detectClones's ignore pattern like .git/**
are not working.
.gitignores
.git/**
and detectClones's ignore pattern **/.git/**
is working though.
Seems to be because fast-glob is being called with a pattern like /Users/maxpatiiuk/site/python/specify7/**/*
That causes it to interpret every relative path ignore pattern to be relative to /
, rather than process.cwd()
Solutions:
jscpd
should either provide the cwd
option to fast-glob instead of putting cwd into the "pattern"jscpd
should prepend every relative path with options.path
This line has no impact as it's result is not assigned back to any variable:
https://github.com/kucherenko/jscpd/blob/d9584f2a248aefb6492139e98d61e9c43bc3abd3/apps/jscpd/src/init/ignore.ts#L15
Perharps it should be
return ignore.map((pattern) => pattern.replace('!', ''));
instead?