Skip to content

Commit

Permalink
fix release tool (#712)
Browse files Browse the repository at this point in the history
  • Loading branch information
dashpole committed Aug 22, 2023
1 parent a092f6c commit 858780d
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions tools/release.go
Expand Up @@ -84,14 +84,16 @@ func (m module) editRequirement(dep, version string) error {
return nil
}

func (m module) version() string {
func (m module) dir() string {
modDir := filepath.Dir(string(m))
if modDir == "." {
modDir = ""
} else {
modDir += "/"
return ""
}
return versionForPath(modDir)
return modDir + "/"
}

func (m module) version() string {
return versionForPath(m.dir())
}

func versionForPath(modDir string) string {
Expand Down Expand Up @@ -153,9 +155,8 @@ func tag() error {
if err != nil {
return err
}
for _, dir := range mods {
ver := versionForPath(string(dir))
tag := string(dir) + "v" + ver
for _, m := range mods {
tag := m.dir() + "v" + m.version()
fmt.Printf("Creating tag %s\n", tag)
cmd := exec.Command("git", "tag", tag)
cmd.Stderr = os.Stderr
Expand Down

0 comments on commit 858780d

Please sign in to comment.