aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bridge/github/config.go6
-rw-r--r--bridge/launchpad/config.go7
-rw-r--r--commands/bridge_configure.go2
3 files changed, 11 insertions, 4 deletions
diff --git a/bridge/github/config.go b/bridge/github/config.go
index e723fda6..3baafadd 100644
--- a/bridge/github/config.go
+++ b/bridge/github/config.go
@@ -44,12 +44,12 @@ func (*Github) Configure(repo repository.RepoCommon, params core.BridgeParams) (
// getting owner and project name
if params.Owner != "" && params.Project != "" {
- // first try to use params if they are both provided
+ // first try to use params if both or project and owner are provided
owner = params.Owner
project = params.Project
} else if params.URL != "" {
- // try to parse them from params URL
+ // try to parse params URL and extract owner and project
_, owner, project, err = splitURL(params.URL)
if err != nil {
return nil, err
@@ -62,7 +62,7 @@ func (*Github) Configure(repo repository.RepoCommon, params core.BridgeParams) (
return nil, err
}
- // try terminal prompt
+ // terminal prompt
owner, project, err = promptURL(remotes)
if err != nil {
return nil, err
diff --git a/bridge/launchpad/config.go b/bridge/launchpad/config.go
index 1c072ad3..6b299a9a 100644
--- a/bridge/launchpad/config.go
+++ b/bridge/launchpad/config.go
@@ -19,6 +19,13 @@ var (
)
func (*Launchpad) Configure(repo repository.RepoCommon, params core.BridgeParams) (core.Configuration, error) {
+ if params.Token != "" {
+ fmt.Println("warn: token is not needed to configure a launchpad-preview bridge")
+ }
+ if params.Owner != "" {
+ fmt.Println("warn: owner is not used when configuring a launchpad-preview bridge")
+ }
+
conf := make(core.Configuration)
var err error
var project string
diff --git a/commands/bridge_configure.go b/commands/bridge_configure.go
index b20b38a5..12f287b8 100644
--- a/commands/bridge_configure.go
+++ b/commands/bridge_configure.go
@@ -114,7 +114,7 @@ var bridgeConfigureCmd = &cobra.Command{
func init() {
bridgeCmd.AddCommand(bridgeConfigureCmd)
bridgeConfigureCmd.Flags().StringVarP(&name, "name", "n", "", "Bridge name")
- bridgeConfigureCmd.Flags().StringVarP(&target, "target", "t", "", "Bridge target name. Valid values are [github,gitlab,gitea,launchpad]")
+ bridgeConfigureCmd.Flags().StringVarP(&target, "target", "t", "", "Bridge target name. Valid values are [github,gitlab,gitea,launchpad-preview]")
bridgeConfigureCmd.Flags().StringVarP(&bridgeParams.URL, "url", "u", "", "Repository url")
bridgeConfigureCmd.Flags().StringVarP(&bridgeParams.Owner, "owner", "o", "", "Repository owner")
bridgeConfigureCmd.Flags().StringVarP(&bridgeParams.Token, "token", "T", "", "Authentication token")