Skip to content

Commit 82ff1af

Browse files
committed
Fix inconsistent metadata versions
1 parent ee5dfc0 commit 82ff1af

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

subcommands/license.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import "path"
1414

1515
const licenseDescription = "Write license terms and metadata."
1616

17+
const currentMetadatVersion = "2.0.0"
18+
1719
// License writes LICENSE and licensezero.json.
1820
var License = &Subcommand{
1921
Tag: "seller",
@@ -183,7 +185,7 @@ func writeCargoTOML(read []byte, cargoTOML string, response *api.PublicResponse,
183185
if !hasMetadata {
184186
metadata = map[string]interface{}{
185187
"licensezero": map[string]interface{}{
186-
"version": "2.0.0",
188+
"version": currentMetadatVersion,
187189
"ids": []interface{}{},
188190
},
189191
}
@@ -245,7 +247,7 @@ func writeLicenseZeroJSON(response *api.PublicResponse, paths *Paths, stack *boo
245247
if err != nil {
246248
if os.IsNotExist(err) {
247249
newMetadata.LicenseZero = []interface{}{newEntry}
248-
newMetadata.Version = "1.0.0"
250+
newMetadata.Version = currentMetadatVersion
249251
} else {
250252
Fail("Could not read licensezero.json.")
251253
}

0 commit comments

Comments
 (0)