Skip to content

Commit

Permalink
Removing double quotes before resolving paths
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomicera committed Feb 22, 2021
1 parent 54269b3 commit 77f2904
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/go-qmstr/common/fileutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ func SetRelativePath(node *service.FileNode, buildPath string, pathSub []*servic
if !filepath.IsAbs(node.Path) {
return nil
}

// Removing double quotes around paths
for _, s := range []*string{&buildPath, &node.Path} {
if len(*s) > 0 && (*s)[0] == '"' {
*s = (*s)[1:]
}
if len(*s) > 0 && (*s)[len(*s)-1] == '"' {
*s = (*s)[:len(*s)-1]
}
}

relPath, err := filepath.Rel(buildPath, node.Path)
if err != nil {
return err
Expand Down

0 comments on commit 77f2904

Please sign in to comment.