[#733] neofs-adm: fetch contracts release from Github

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2021-10-21 18:32:01 +03:00 committed by Alex Vanin
parent c1e1b65ad9
commit 0b6350d463
4 changed files with 67 additions and 2 deletions

View file

@ -127,6 +127,14 @@ func newInitializeContext(cmd *cobra.Command, v *viper.Viper) (*initializeContex
if err != nil {
return nil, fmt.Errorf("missing contracts path: %w", err)
}
if ctrPath == "" {
cmd.Println("Contracts flag is missing, latest release will be fetched from Github.")
ctrPath, err = downloadContractsFromGithub(cmd)
if err != nil {
return nil, err
}
cmd.Printf("Saved to %s\n", ctrPath)
}
}
ns, err := c.GetNativeContracts()