Skip to content

Commit

Permalink
🐛 Fix file uri path for deps on windows (#772)
Browse files Browse the repository at this point in the history
Resolves https://issues.redhat.com/browse/MTA-4636

Signed-off-by: Emily McMullan <emcmulla@redhat.com>
  • Loading branch information
eemcmullan authored Feb 12, 2025
1 parent 175fd3f commit 02ecd53
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"path/filepath"
"reflect"
"regexp"
"runtime"
"strings"

"github.com/konveyor/analyzer-lsp/engine/labels"
Expand Down Expand Up @@ -721,9 +722,17 @@ func (p *javaServiceClient) parseDepString(dep, localRepoPath, pomPath string) (

fp := resolveDepFilepath(&d, p, group, artifact, localRepoPath)

// if windows home path begins with C:
if !strings.HasPrefix(fp, "/") {
fp = "/" + fp
}
d.Labels = addDepLabels(p.depToLabels, d.Name)
d.FileURIPrefix = fmt.Sprintf("file://%v", filepath.Dir(fp))

if runtime.GOOS == "windows" {
d.FileURIPrefix = strings.ReplaceAll(d.FileURIPrefix, "\\", "/")
}

d.Extras = map[string]interface{}{
groupIdKey: group,
artifactIdKey: artifact,
Expand Down

0 comments on commit 02ecd53

Please sign in to comment.