Essentially the issue we are running into is that our expandGlobs function is returning too soon and not looking deep enough into a directory. For example, in portal we have the globs of ['/apps/*/*', '/apps/*/*/*']. This means we want to check for directories in both the 2nd and 3rd level deep from "apps". An example of this is that we would want to match both apps/frontend-js/frontend-js-web and additionally match apps/headless/headless-builder/headless-builder-web.
This doesn't actually work as we expected though because expandGlobs gets a postive hit for apps/headless/headless-builder and then doesn't look any deeper. The change I am making here ensures that we continue to look deeper in the file structure in case another matcher returns a hit.
This issue originally appeared here, https://liferay.slack.com/archives/C03CAD9EF/p1684869953566979?thread_ts=1684869909.630399&cid=C03CAD9EF
Essentially the issue we are running into is that our
expandGlobs
function is returning too soon and not looking deep enough into a directory. For example, in portal we have the globs of['/apps/*/*', '/apps/*/*/*']
. This means we want to check for directories in both the 2nd and 3rd level deep from "apps". An example of this is that we would want to match bothapps/frontend-js/frontend-js-web
and additionally matchapps/headless/headless-builder/headless-builder-web
.This doesn't actually work as we expected though because expandGlobs gets a postive hit for
apps/headless/headless-builder
and then doesn't look any deeper. The change I am making here ensures that we continue to look deeper in the file structure in case another matcher returns a hit.The first commit is my fix
The second commit is an improvement because I noticed we were at times globbing way more files than we wanted.