mirror of
https://github.com/anchore/syft.git
synced 2026-11-03 07:56:36 +01:00
fix: trim path from deps.json in portable way (#2674)
* fix: trim path from deps.json in portable way Previously, the path trimming regex would leave leading path separator in place on Windows. Probably a better long term fix is to a library path operation. Signed-off-by: Will Murphy <will.murphy@anchore.com>
This commit is contained in:
@@ -37,7 +37,7 @@ func newDotnetDepsPackage(nameVersion string, lib dotnetDepsLibrary, locations .
|
||||
}
|
||||
|
||||
func getDepsJSONFilePrefix(p string) string {
|
||||
r := regexp.MustCompile(`([^\/]+)\.deps\.json$`)
|
||||
r := regexp.MustCompile(`([^\\\/]+)\.deps\.json$`)
|
||||
match := r.FindStringSubmatch(p)
|
||||
if len(match) > 1 {
|
||||
return match[1]
|
||||
|
||||
Reference in New Issue
Block a user