From 0de2bd92b034ec265dbc66751626b4db67983760 Mon Sep 17 00:00:00 2001 From: Amine Hilaly Date: Sat, 25 May 2019 15:56:52 +0200 Subject: Launchpad bridge configuration from `BridgeParams` Project and URL Improve Github config comments --- bridge/github/config.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'bridge/github') diff --git a/bridge/github/config.go b/bridge/github/config.go index f2ac750e..e723fda6 100644 --- a/bridge/github/config.go +++ b/bridge/github/config.go @@ -42,25 +42,27 @@ func (*Github) Configure(repo repository.RepoCommon, params core.BridgeParams) ( var owner string var project string - // getting owner and project name: - // first use directly params if they are both provided, else try to parse - // them from params URL, and finaly try getting them from terminal prompt + // getting owner and project name if params.Owner != "" && params.Project != "" { + // first try to use params if they are both provided owner = params.Owner project = params.Project } else if params.URL != "" { + // try to parse them from params URL _, owner, project, err = splitURL(params.URL) if err != nil { return nil, err } } else { + // remote suggestions remotes, err := repo.GetRemotes() if err != nil { return nil, err } + // try terminal prompt owner, project, err = promptURL(remotes) if err != nil { return nil, err -- cgit