6
0
mirror of https://github.com/grdl/git-get.git synced 2026-02-04 23:49:42 +00:00

Replace path.Join with filepath.Join

Path is for URLs, filepath is for os paths. This solves the problem with wrong repo root on windows.
This commit is contained in:
Grzegorz Dlugoszewski
2020-06-30 11:25:49 +02:00
parent b8606568ef
commit 235ea0d811
4 changed files with 10 additions and 10 deletions

View File

@@ -2,7 +2,7 @@ package pkg
import (
urlpkg "net/url"
"path"
"path/filepath"
"regexp"
"strings"
@@ -67,7 +67,7 @@ func URLToPath(url *urlpkg.URL) (repoPath string) {
repoHost := strings.Split(url.Host, ":")[0]
// Remove trailing ".git" from repo name
repoPath = path.Join(repoHost, url.Path)
repoPath = filepath.Join(repoHost, url.Path)
repoPath = strings.TrimSuffix(repoPath, ".git")
// Remove tilde (~) char from username