Skip to content

Commit 6dcab6b

Browse files
committed
support taps with custom urls
1 parent 7bdc5df commit 6dcab6b

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

brew.go

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,18 +139,26 @@ func (t *Taps) UnmarshalJSON(b []byte) error {
139139
}
140140
seen := map[string]bool{}
141141
for _, tap := range intermediary {
142-
if seen[string(tap)] {
143-
return fmt.Errorf("error: contains duplicate tap %s", string(tap))
142+
if seen[tap.String()] {
143+
return fmt.Errorf("error: contains duplicate tap %s", tap)
144144
}
145-
seen[string(tap)] = true
145+
seen[tap.String()] = true
146146
}
147147
*t = intermediary
148148
return nil
149149
}
150150

151-
type Tap string
151+
type Tap struct {
152+
Repo string `json:"repo"`
153+
URL string `json:"url"`
154+
}
152155

153-
func (t Tap) String() string { return fmt.Sprintf(`tap "%s"`, string(t)) }
156+
func (t Tap) String() string {
157+
if t.URL == "" {
158+
return fmt.Sprintf(`tap "%s"`, t.Repo)
159+
}
160+
return fmt.Sprintf(`tap "%s", "%s"`, t.Repo, t.URL)
161+
}
154162

155163
type Pkgs []Pkg
156164

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
set -euo pipefail
2929

30-
version=0.0.9 # TODO integrate with releases.
30+
version=0.0.10 # TODO integrate with releases.
3131

3232
settle_base=$(pwd)
3333

settle.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ files:
1010

1111
brew:
1212
taps:
13-
- homebrew/core
14-
- homebrew/bundle
15-
- homebrew/services
16-
- homebrew/cask
17-
- homebrew/cask-fonts
18-
- homebrew/cask-versions
13+
- repo: homebrew/core
14+
- repo: homebrew/bundle
15+
- repo: homebrew/services
16+
- repo: homebrew/cask
17+
- repo: homebrew/cask-fonts
18+
- repo: homebrew/cask-versions
1919
pkgs:
2020
# core
2121
- name: age

0 commit comments

Comments
 (0)