You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add an optional field to the Info struct that can be injected outside as cobra context.
// ExtraInfo contains a set of extra information provided by appstypeExtraInfomap[string]string// Info defines the application version information.typeInfostruct {
Namestring`json:"name" yaml:"name"`AppNamestring`json:"server_name" yaml:"server_name"`Versionstring`json:"version" yaml:"version"`GitCommitstring`json:"commit" yaml:"commit"`BuildTagsstring`json:"build_tags" yaml:"build_tags"`GoVersionstring`json:"go" yaml:"go"`BuildDeps []buildDep`json:"build_deps" yaml:"build_deps"`CosmosSdkVersionstring`json:"cosmos_sdk_version" yaml:"cosmos_sdk_version"`ExtraInfo*ExtraInfo`json:"extra_info" yaml:"extra_info"`
}
// VersionCommand ...// The context must be set from the root command as PersistentPreRunRunE: func(cmd*cobra.Command, _ []string) error {
verInfo:=NewInfo()
iflong, _:=cmd.Flags().GetBool(flagLong); !long {
cmd.Println(verInfo.Version)
returnnil
}
extraInfo:=extraInfoFromContext(cmd)
...
},
For Admin Use
Not duplicate issue
Appropriate labels applied
Appropriate contributors tagged
Contributor assigned/self-assigned
The text was updated successfully, but these errors were encountered:
Summary
Allow apps to provide extra information to version command
Problem Definition
Currently the information comes from this method
cosmos-sdk/version/version.go
Line 66 in 9bed633
Build tags don't work for runtime information like CosmWasm VM providing it's version through the dynamic library
CosmWasm/wasmvm#314
Proposal
Add an optional field to the
Info
struct that can be injected outside as cobra context.For Admin Use
The text was updated successfully, but these errors were encountered: