tangled
alpha
login
or
join now
fuwn.net
/
yae
0
fork
atom
⛩️ Powerful yet Minimal Nix Dependency Manager
flake
flakes
home-manager
nixos
go
nix
dependency
dependencies
0
fork
atom
overview
issues
pulls
pipelines
fix(source): dynamically identify host
fuwn.net
1 year ago
9f6bf390
2036ad87
verified
This commit was signed with the committer's
known signature
.
fuwn.net
SSH Key Fingerprint:
SHA256:VPdFPyPbd6JkoMyWUdZ/kkTcIAt3sxjXD2XSAZ7FYC4=
+10
-1
1 changed file
expand all
collapse all
unified
split
internal
yae
source.go
+10
-1
internal/yae/source.go
···
2
2
3
3
import (
4
4
"fmt"
5
5
+
"net/url"
5
6
"strings"
6
7
7
8
"github.com/charmbracelet/log"
···
91
92
92
93
func (source *Source) fetchLatestGitTag() (string, error) {
93
94
if source.Type == "git" {
94
94
-
repository := "https://github.com/" + strings.Split(source.URL, "/")[3] + "/" + strings.Split(source.URL, "/")[4]
95
95
+
url, err := url.Parse(source.URL)
96
96
+
97
97
+
if err != nil {
98
98
+
return "", err
99
99
+
}
100
100
+
101
101
+
domain := url.Host
102
102
+
pathSegments := strings.Split(url.Path, "/")
103
103
+
repository := url.Scheme + "://" + domain + "/" + pathSegments[1] + "/" + pathSegments[2]
95
104
remotes, err := command("bash", false, "-c", fmt.Sprintf("git ls-remote %s | awk -F'/' '{print $NF}' | sort -V", repository))
96
105
97
106
if err != nil {