Skip to content

Commit 2a7cd7c

Browse files
committed
feat: adds ability to specifiy branch or tag when adding new registry
1 parent 2e354f8 commit 2a7cd7c

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/bubbles/app.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type Model struct {
4242

4343
func New() Model {
4444
input := textinput.New()
45-
input.Placeholder = "github/<username>/<repo>"
45+
input.Placeholder = "github/<username>/<repo>@<branch>"
4646
return Model{
4747
registryselector: registry_selector.New(),
4848
blocklist: block_list.New(),

src/commands/manifest/fetcher.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,14 @@ type BannerErrorMessage string
1414

1515
func GetManifest(provider string) tea.Cmd {
1616
return func() tea.Msg {
17-
url := strings.Replace(provider, "github", "https://raw.githubusercontent.com", 1)
18-
url = fmt.Sprintf("%s%s", url, "/refs/heads/master/jsrepo-manifest.json")
19-
17+
parts := strings.Split(provider, "@")
18+
providerURL := parts[0]
19+
branch := "master" // default branch
20+
if len(parts) > 1 {
21+
branch = parts[1]
22+
}
23+
url := strings.Replace(providerURL, "github", "https://raw.githubusercontent.com", 1)
24+
url = fmt.Sprintf("%s%s", url, "/refs/heads/"+branch+"/jsrepo-manifest.json")
2025
resp, err := http.Get(url)
2126
if err != nil {
2227
fmt.Printf("Error getting manifest: %v\n", err)

0 commit comments

Comments
 (0)