Fixed issue with logging and getting latest version

This commit is contained in:
Tim Shannon 2016-04-05 21:08:08 -05:00
parent 65c489c920
commit acfa4ff7fe
2 changed files with 6 additions and 5 deletions

View File

@ -220,7 +220,7 @@ func (p *Project) fetch() {
}
//log fetch results
if p.errHandled(p.ds.AddLog(p.stage, p.version, string(fetchResult))) {
if p.errHandled(p.ds.AddLog(p.version, p.stage, string(fetchResult))) {
return
}
@ -241,7 +241,7 @@ func (p *Project) build() {
return
}
if p.errHandled(p.ds.AddLog(p.stage, p.version, string(output))) {
if p.errHandled(p.ds.AddLog(p.version, p.stage, string(output))) {
return
}
@ -260,7 +260,7 @@ func (p *Project) test() {
return
}
if p.errHandled(p.ds.AddLog(p.stage, p.version, string(output))) {
if p.errHandled(p.ds.AddLog(p.version, p.stage, string(output))) {
return
}
@ -280,7 +280,7 @@ func (p *Project) release() {
return
}
if p.errHandled(p.ds.AddLog(p.stage, p.version, string(output))) {
if p.errHandled(p.ds.AddLog(p.version, p.stage, string(output))) {
return
}

View File

@ -41,7 +41,7 @@ func (ds *Store) LatestVersion() (string, error) {
err := ds.bolt.View(func(tx *bolt.Tx) error {
c := tx.Bucket([]byte(bucketLog)).Cursor()
for k, v := c.Last(); k != nil; k, v = c.Prev() {
for k, v := c.First(); k != nil; k, v = c.Next() {
l := &log{}
err := json.Unmarshal(v, l)
if err != nil {
@ -60,5 +60,6 @@ func (ds *Store) LatestVersion() (string, error) {
if err != nil {
return "", err
}
return version, nil
}