diff --git a/internal/bindown/install.go b/internal/bindown/install.go index bf47651..1d0c941 100644 --- a/internal/bindown/install.go +++ b/internal/bindown/install.go @@ -205,6 +205,11 @@ func createBindownWrapper(target, cacheDir, tag, baseURL string) (string, error) // relPath returns target relative to base and converted to slash-separated path. // Unlike filepath.Rel, it converts both paths to absolute paths before calculating the relative path. func relPath(base, target string) (string, error) { + // if it works without abs, use that + rel, err := filepath.Rel(base, target) + if err == nil { + return filepath.ToSlash(rel), nil + } absBase, err := filepath.Abs(base) if err != nil { return "", err @@ -221,7 +226,7 @@ func relPath(base, target string) (string, error) { if err != nil { return "", err } - rel, err := filepath.Rel(absBase, absTarget) + rel, err = filepath.Rel(absBase, absTarget) if err != nil { return "", err }