Merge pull request #205 from sgotti/remotesource_create_fix_forced_github_defaults
cmd: remotesource create don't force github defaults
This commit is contained in:
commit
2750598a86
@ -83,10 +83,16 @@ func init() {
|
|||||||
func remoteSourceCreate(cmd *cobra.Command, args []string) error {
|
func remoteSourceCreate(cmd *cobra.Command, args []string) error {
|
||||||
gwclient := gwclient.NewClient(gatewayURL, token)
|
gwclient := gwclient.NewClient(gatewayURL, token)
|
||||||
|
|
||||||
|
flags := cmd.Flags()
|
||||||
|
|
||||||
// for github remote source type, set defaults for github.com
|
// for github remote source type, set defaults for github.com
|
||||||
if remoteSourceCreateOpts.rsType == "github" {
|
if remoteSourceCreateOpts.rsType == "github" {
|
||||||
remoteSourceCreateOpts.apiURL = github.GitHubAPIURL
|
if !flags.Changed("api-url") {
|
||||||
remoteSourceCreateOpts.sshHostKey = github.GitHubSSHHostKey
|
remoteSourceCreateOpts.apiURL = github.GitHubAPIURL
|
||||||
|
}
|
||||||
|
if remoteSourceCreateOpts.apiURL == github.GitHubAPIURL && !flags.Changed("ssh-host-key") {
|
||||||
|
remoteSourceCreateOpts.sshHostKey = github.GitHubSSHHostKey
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if remoteSourceCreateOpts.apiURL == "" {
|
if remoteSourceCreateOpts.apiURL == "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user