Skip to content

Commit

Permalink
Fix inconsistent metadata versions
Browse files Browse the repository at this point in the history
  • Loading branch information
kemitchell committed Nov 12, 2019
1 parent ee5dfc0 commit 82ff1af
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions subcommands/license.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import "path"

const licenseDescription = "Write license terms and metadata."

const currentMetadatVersion = "2.0.0"

// License writes LICENSE and licensezero.json.
var License = &Subcommand{
Tag: "seller",
Expand Down Expand Up @@ -183,7 +185,7 @@ func writeCargoTOML(read []byte, cargoTOML string, response *api.PublicResponse,
if !hasMetadata {
metadata = map[string]interface{}{
"licensezero": map[string]interface{}{
"version": "2.0.0",
"version": currentMetadatVersion,
"ids": []interface{}{},
},
}
Expand Down Expand Up @@ -245,7 +247,7 @@ func writeLicenseZeroJSON(response *api.PublicResponse, paths *Paths, stack *boo
if err != nil {
if os.IsNotExist(err) {
newMetadata.LicenseZero = []interface{}{newEntry}
newMetadata.Version = "1.0.0"
newMetadata.Version = currentMetadatVersion
} else {
Fail("Could not read licensezero.json.")
}
Expand Down

0 comments on commit 82ff1af

Please sign in to comment.