Skip to content

Commit 8ba3bf1

Browse files
Merge pull request #149 from ibuildthecloud/repo-url-fix
Fix tools from repos referencing other repos
2 parents e4b7d18 + 246f923 commit 8ba3bf1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pkg/loader/url.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ func AddVSC(lookup VCSLookup) {
2121

2222
func loadURL(ctx context.Context, base *source, name string) (*source, bool, error) {
2323
var (
24-
repo *types.Repo
25-
url = name
24+
repo *types.Repo
25+
url = name
26+
relative = strings.HasPrefix(name, ".") || !strings.Contains(name, "/")
2627
)
2728

28-
if base.Path != "" {
29+
if base.Path != "" && relative {
2930
url = base.Path + "/" + name
3031
}
3132

@@ -37,7 +38,7 @@ func loadURL(ctx context.Context, base *source, name string) (*source, bool, err
3738
repo = &newRepo
3839
}
3940

40-
if repo == nil {
41+
if repo == nil || !relative {
4142
for _, vcs := range vcsLookups {
4243
newURL, newRepo, ok, err := vcs(name)
4344
if err != nil {

0 commit comments

Comments
 (0)