Skip to content

Commit

Permalink
fixed purge/repush error when storing multiple files
Browse files Browse the repository at this point in the history
  • Loading branch information
kendavis2 committed Mar 8, 2020
1 parent 822bbb3 commit f7a2eb1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ require (
github.com/aws/aws-sdk-go v1.29.18
github.com/fatih/color v1.9.0
github.com/keybase/go-keychain v0.0.0-20200218013740-86d4642e4ce2
github.com/mattn/go-colorable v0.1.4
github.com/mitchellh/go-homedir v1.1.0
github.com/satori/go.uuid v1.2.0
github.com/spf13/cobra v0.0.6 // indirect
github.com/spf13/viper v1.6.2 // indirect
github.com/spf13/cobra v0.0.6
github.com/spf13/viper v1.6.2
github.com/subosito/gotenv v1.2.0
github.com/tidwall/gjson v1.6.0
github.com/tidwall/sjson v1.0.4
Expand Down
3 changes: 3 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvW
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
Expand Down Expand Up @@ -176,6 +178,7 @@ google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZi
google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno=
gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
Expand Down
4 changes: 3 additions & 1 deletion v4/components/catalog/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package catalog

import (
"errors"

"time"

"github.com/turnerlabs/cstore/v4/components/local"
Expand All @@ -13,7 +14,7 @@ const name = "state.yml"

// RemoveRecords ...
func (c Catalog) RemoveRecords(fileName string) error {
pulls := map[string]time.Time{}
pulls := map[string]State{}

b, err := local.Get(name, "")
if err == nil {
Expand All @@ -34,6 +35,7 @@ func (c Catalog) RemoveRecords(fileName string) error {

// RecordPull ...
func (c Catalog) RecordPull(fileName string, lastPull time.Time, version string) error {

if lastPull.IsZero() {
return errors.New("invalid time")
}
Expand Down

0 comments on commit f7a2eb1

Please sign in to comment.