Skip to content

Commit

Permalink
hof/create: skip check if version is set
Browse files Browse the repository at this point in the history
  • Loading branch information
verdverm committed Sep 22, 2022
1 parent c7c0874 commit eb6232d
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions lib/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,22 @@ func Create(module string, rootflags flags.RootPflagpole, cmdflags flags.CreateF
ver = "latest"
}

refVal, refType, refCommit, err := cache.FindBestRef(url, ver)
ref := ver

if ver == "latest" {
refVal, refType, refCommit, err := cache.FindBestRef(url, ver)
fmt.Println("found:", refVal, refType, refCommit)
if err != nil {
return err
}
if refType != "tags" {
return fmt.Errorf("create currently only supports tags")
}
ref = refVal
}
if err != nil {
return err
}
if refType != "tags" {
return fmt.Errorf("create currently only supports tags")
}
// fmt.Printf("looking for %s @ %s\n", url, ver)

fmt.Println("setting up...")
tmpdir, subdir, err = setupTmpdir(url, refVal)
tmpdir, subdir, err = setupTmpdir(url, ref)
if err != nil {
return fmt.Errorf("while setting up tmpdir: %w", err)
}
Expand Down

0 comments on commit eb6232d

Please sign in to comment.