diff options
Diffstat (limited to 'addRepo.go')
| -rw-r--r-- | addRepo.go | 44 |
1 files changed, 30 insertions, 14 deletions
@@ -17,8 +17,8 @@ func RemoveFirstElement(slice []string) (string, []string) { // homeDir, _ := os.UserHomeDir() -func (c *controlBox) addRepo(path string) { - path = strings.Trim(path, "/") // trim any extranous '/' chars put in the config file by the user +func (c *controlBox) addRepo() { + path := strings.Trim(me.goPath, "/") // trim any extranous '/' chars put in the config file by the user if path == "" { log.Warn("addRepo() got empty path", path) return @@ -53,24 +53,41 @@ func (c *controlBox) addRepo(path string) { c.tagDate = gadgets.NewBasicEntry(c.grid, "git tag Date") c.grid.NextRow() - cbname := repo.GetCurrentBranchName() - cbversion := repo.GetCurrentBranchVersion() - debversion := repo.DebianCurrentVersion() + var cbname string + var cbversion string + var debversion string - if repo.CheckDirty() { - c.dirtyL.SetText("true") + if me.repo == nil { + cbname = "todo" + cbversion = "todo version" + debversion = "todo deb version" } else { - c.dirtyL.SetText("false") + cbname = me.repo.GetCurrentBranchName() + cbversion = me.repo.GetCurrentBranchVersion() + debversion = me.repo.DebianCurrentVersion() + } + + if me.repo == nil { + c.dirtyL.SetText("unknown") + } else { + if me.repo.CheckDirty() { + c.dirtyL.SetText("true") + } else { + c.dirtyL.SetText("false") + } } if c.GoPath.String() == "" { - c.GoPath.SetText(repo.GetGoPath()) + c.GoPath.SetText(me.goPath) } - lasttag := repo.GetLastTagVersion() - if argv.Release { - debversion = repo.DebianReleaseVersion() - c.dirtyL.SetText("false") + var lasttag string = "unknown" + if me.repo != nil { + lasttag = me.repo.GetLastTagVersion() + if argv.Release { + debversion = me.repo.DebianReleaseVersion() + c.dirtyL.SetText("false") + } } c.Version.SetText(debversion) @@ -80,6 +97,5 @@ func (c *controlBox) addRepo(path string) { tagDate := c.getDateStamp(lasttag) c.tagDate.SetText(tagDate) - return } |
