Warn when no version is provided

This commit is contained in:
comp500 2021-12-28 22:32:18 +00:00
parent ce49820ef5
commit 20e57ac220

View File

@ -170,6 +170,10 @@ var exportCmd = &cobra.Command{
Dependencies: dependencies, Dependencies: dependencies,
} }
if len(pack.Version) == 0 {
fmt.Println("Warning: pack.toml version field must not be empty to create a valid Modrinth pack")
}
w := json.NewEncoder(manifestFile) w := json.NewEncoder(manifestFile)
w.SetIndent("", " ") // Documentation uses 4 spaces w.SetIndent("", " ") // Documentation uses 4 spaces
err = w.Encode(manifest) err = w.Encode(manifest)