diff options
author | Amine Hilaly <hilalyamine@gmail.com> | 2019-08-21 14:24:48 +0200 |
---|---|---|
committer | Amine Hilaly <hilalyamine@gmail.com> | 2019-08-31 23:02:20 +0200 |
commit | 0381400bfda16f910ca87b0258ddda1c1732fbc7 (patch) | |
tree | 54a271f43bafbbc238e2fc26bb6fa67d6403c4af /bridge/launchpad | |
parent | c7792a5d1279a92c8d0caf67a0cf688cc9e32e09 (diff) | |
download | git-bug-0381400bfda16f910ca87b0258ddda1c1732fbc7.tar.gz |
commands: read token from stdin in bridge configuration
bridge: improve bridge config validation
Diffstat (limited to 'bridge/launchpad')
-rw-r--r-- | bridge/launchpad/config.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bridge/launchpad/config.go b/bridge/launchpad/config.go index 1d6c8aba..6669d0fa 100644 --- a/bridge/launchpad/config.go +++ b/bridge/launchpad/config.go @@ -22,7 +22,7 @@ const ( defaultTimeout = 60 * time.Second ) -func (*Launchpad) Configure(repo repository.RepoCommon, params core.BridgeParams) (core.Configuration, error) { +func (l *Launchpad) Configure(repo repository.RepoCommon, params core.BridgeParams) (core.Configuration, error) { if params.Token != "" { fmt.Println("warning: --token is ineffective for a Launchpad bridge") } @@ -63,6 +63,12 @@ func (*Launchpad) Configure(repo repository.RepoCommon, params core.BridgeParams conf[keyProject] = project conf[core.KeyTarget] = target + + err = l.ValidateConfig(conf) + if err != nil { + return nil, err + } + return conf, nil } |