Skip to content

Commit 7a0ad11

Browse files
committed
address coverage
1 parent 8585a05 commit 7a0ad11

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

bundler/extension_refs.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,10 @@ func rebaseExtensionRefForComposed(refValue string, sourceIdx, rootIdx *index.Sp
204204
if !filepath.IsAbs(targetPath) {
205205
targetPath = utils.CheckPathOverlap(sourceDir, targetPath, string(os.PathSeparator))
206206
}
207-
absTarget, err := filepath.Abs(targetPath)
207+
targetPath = filepath.Clean(targetPath)
208+
relTarget, err := filepath.Rel(rootDir, targetPath)
208209
if err != nil {
209-
return refValue
210-
}
211-
relTarget, err := filepath.Rel(rootDir, absTarget)
212-
if err != nil {
213-
return filepath.ToSlash(absTarget) + fragment
210+
return filepath.ToSlash(targetPath) + fragment
214211
}
215212
return filepath.ToSlash(relTarget) + fragment
216213
}

0 commit comments

Comments
 (0)