forked from TrueCloudLab/frostfs-node
[#466] adm: Allow to download contracts from Gitea
Signed-off-by: Olga Konstantinova <kola43843@gmail.com>
This commit is contained in:
parent
805862f4b7
commit
80b581d499
6 changed files with 129 additions and 7 deletions
|
@ -399,10 +399,14 @@ func (c *initializeContext) readContracts(names []string) error {
|
|||
}
|
||||
} else {
|
||||
var r io.ReadCloser
|
||||
if c.ContractPath == "" {
|
||||
return errors.New("contracts flag is missing")
|
||||
if c.ContractPath != "" {
|
||||
r, err = os.Open(c.ContractPath)
|
||||
} else if c.ContractURL != "" {
|
||||
r, err = downloadContracts(c.Command, c.ContractURL)
|
||||
} else {
|
||||
r, err = downloadContractsFromRepository(c.Command)
|
||||
}
|
||||
r, err = os.Open(c.ContractPath)
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("can't open contracts archive: %w", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue