Handles this error:
error: the string 'mh6zkfrj8pmwbn8gsyi6wmrilj96d60y-fixture1' is not allowed to refer to a store path
This happens because the substring has the string context propagated to
it, and Nix doesn't like attrset accessor containing those. We know it's
safe to remove the string context because the string won't be added to a
derivation.
What an asserted directory should be is:
- an absolute path
- of an existing
- directory.
`isPath` is too strict in this case since it doesn't allow strings.
`pathExists` checks for the first two property while the last one is
asserted with `readDir`.
* Make paths also match subdirectories
This makes matchers that are generated for strings and paths treat the
path as a prefix instead of as the entire path, allowing a path to also
match its subdirectories and contained files.
This allows patterns like `"src"` to also match by default:
- `src/folder_x`
- `src/folder_x/folder_y`
- etc.
* Turn _isPathPrefix into new matcher and restore previous default path behavior
* Update inDirectory to compare string prefixes instead of path segments
This avoids the extra work of splitting the paths into segments and
comparing them piece by piece.
* proposed change
Co-authored-by: zimbatm <zimbatm@zimbatm.com>