diff --git a/api/client.go b/api/client.go index 2b7e6df4..31863d49 100644 --- a/api/client.go +++ b/api/client.go @@ -14,7 +14,7 @@ import ( "time" "github.com/profclems/glab/internal/config" - "github.com/profclems/glab/internal/glinstance" + "github.com/profclems/glab/pkg/glinstance" "github.com/xanzy/go-gitlab" ) diff --git a/cmd/glab/main.go b/cmd/glab/main.go index 67a0c4df..1ecd36f1 100644 --- a/cmd/glab/main.go +++ b/cmd/glab/main.go @@ -20,8 +20,8 @@ import ( "github.com/profclems/glab/commands/help" "github.com/profclems/glab/commands/update" "github.com/profclems/glab/internal/config" - "github.com/profclems/glab/internal/glinstance" "github.com/profclems/glab/internal/run" + "github.com/profclems/glab/pkg/glinstance" "github.com/profclems/glab/pkg/tableprinter" "github.com/profclems/glab/pkg/utils" diff --git a/commands/api/api.go b/commands/api/api.go index 74b0eea6..677c259d 100644 --- a/commands/api/api.go +++ b/commands/api/api.go @@ -22,8 +22,8 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/profclems/glab/commands/cmdutils" "github.com/profclems/glab/internal/config" - "github.com/profclems/glab/internal/glinstance" "github.com/profclems/glab/internal/glrepo" + "github.com/profclems/glab/pkg/glinstance" "github.com/spf13/cobra" jsonPretty "github.com/tidwall/pretty" "github.com/xanzy/go-gitlab" diff --git a/commands/auth/login/login.go b/commands/auth/login/login.go index 8776b1e4..60ce530e 100644 --- a/commands/auth/login/login.go +++ b/commands/auth/login/login.go @@ -17,7 +17,7 @@ import ( "github.com/profclems/glab/api" "github.com/profclems/glab/commands/cmdutils" "github.com/profclems/glab/internal/config" - "github.com/profclems/glab/internal/glinstance" + "github.com/profclems/glab/pkg/glinstance" "github.com/spf13/cobra" ) @@ -125,6 +125,7 @@ func loginRun() error { hostname := opts.Hostname apiHostname := opts.Hostname + defaultHostname := glinstance.OverridableDefault() isSelfHosted := false if hostname == "" { @@ -132,7 +133,7 @@ func loginRun() error { err := survey.AskOne(&survey.Select{ Message: "What GitLab instance do you want to log into?", Options: []string{ - "GitLab.com", + defaultHostname, "GitLab Self-hosted Instance", }, }, &hostType) @@ -143,7 +144,7 @@ func loginRun() error { isSelfHosted = hostType == 1 - hostname = glinstance.Default() + hostname = defaultHostname apiHostname = hostname if isSelfHosted { err := survey.AskOne(&survey.Input{ diff --git a/commands/auth/status/status.go b/commands/auth/status/status.go index 5990f1e9..eb8fc9a2 100644 --- a/commands/auth/status/status.go +++ b/commands/auth/status/status.go @@ -9,7 +9,7 @@ import ( "github.com/profclems/glab/api" "github.com/profclems/glab/commands/cmdutils" "github.com/profclems/glab/internal/config" - "github.com/profclems/glab/internal/glinstance" + "github.com/profclems/glab/pkg/glinstance" "github.com/spf13/cobra" ) diff --git a/commands/cmdutils/factory.go b/commands/cmdutils/factory.go index f499376c..a42a9109 100644 --- a/commands/cmdutils/factory.go +++ b/commands/cmdutils/factory.go @@ -7,9 +7,9 @@ import ( "github.com/profclems/glab/api" "github.com/profclems/glab/internal/config" - "github.com/profclems/glab/internal/glinstance" "github.com/profclems/glab/internal/glrepo" "github.com/profclems/glab/pkg/git" + "github.com/profclems/glab/pkg/glinstance" "github.com/profclems/glab/pkg/iostreams" "github.com/xanzy/go-gitlab" ) diff --git a/commands/cmdutils/remote_resolver.go b/commands/cmdutils/remote_resolver.go index 71214bbd..5aa84436 100644 --- a/commands/cmdutils/remote_resolver.go +++ b/commands/cmdutils/remote_resolver.go @@ -7,9 +7,9 @@ import ( "strings" "github.com/profclems/glab/internal/config" - "github.com/profclems/glab/internal/glinstance" "github.com/profclems/glab/internal/glrepo" "github.com/profclems/glab/pkg/git" + "github.com/profclems/glab/pkg/glinstance" ) type remoteResolver struct { diff --git a/commands/config/config.go b/commands/config/config.go index 4acdb4fa..2f912407 100644 --- a/commands/config/config.go +++ b/commands/config/config.go @@ -6,7 +6,7 @@ import ( "github.com/MakeNowJust/heredoc" "github.com/profclems/glab/commands/cmdutils" "github.com/profclems/glab/internal/config" - "github.com/profclems/glab/internal/glinstance" + "github.com/profclems/glab/pkg/glinstance" "github.com/spf13/cobra" ) diff --git a/commands/project/clone/repo_clone.go b/commands/project/clone/repo_clone.go index 0f842825..99f30171 100644 --- a/commands/project/clone/repo_clone.go +++ b/commands/project/clone/repo_clone.go @@ -11,9 +11,9 @@ import ( "github.com/profclems/glab/api" "github.com/profclems/glab/commands/cmdutils" "github.com/profclems/glab/internal/config" - "github.com/profclems/glab/internal/glinstance" "github.com/profclems/glab/internal/glrepo" "github.com/profclems/glab/pkg/git" + "github.com/profclems/glab/pkg/glinstance" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/xanzy/go-gitlab" diff --git a/commands/release/create/create.go b/commands/release/create/create.go index 613fb83a..e9e448d6 100644 --- a/commands/release/create/create.go +++ b/commands/release/create/create.go @@ -20,8 +20,8 @@ import ( "github.com/profclems/glab/pkg/surveyext" "github.com/profclems/glab/pkg/utils" - "github.com/profclems/glab/internal/glinstance" "github.com/profclems/glab/internal/glrepo" + "github.com/profclems/glab/pkg/glinstance" "github.com/profclems/glab/pkg/iostreams" "github.com/profclems/glab/commands/cmdutils" diff --git a/commands/release/releaseutils/releaseutils.go b/commands/release/releaseutils/releaseutils.go index a9e61370..9f0bb5fc 100644 --- a/commands/release/releaseutils/releaseutils.go +++ b/commands/release/releaseutils/releaseutils.go @@ -6,8 +6,8 @@ import ( "os" "strings" - "github.com/profclems/glab/internal/glinstance" "github.com/profclems/glab/internal/glrepo" + "github.com/profclems/glab/pkg/glinstance" "github.com/profclems/glab/commands/release/releaseutils/upload" diff --git a/commands/release/releaseutils/upload/upload.go b/commands/release/releaseutils/upload/upload.go index 4b6ff8cb..8d17e4ba 100644 --- a/commands/release/releaseutils/upload/upload.go +++ b/commands/release/releaseutils/upload/upload.go @@ -4,7 +4,7 @@ import ( "fmt" "io" - "github.com/profclems/glab/internal/glinstance" + "github.com/profclems/glab/pkg/glinstance" "github.com/profclems/glab/pkg/iostreams" "github.com/xanzy/go-gitlab" ) diff --git a/commands/release/view/view.go b/commands/release/view/view.go index b8840fd3..b5c7750e 100644 --- a/commands/release/view/view.go +++ b/commands/release/view/view.go @@ -8,8 +8,8 @@ import ( "github.com/profclems/glab/commands/cmdutils" "github.com/profclems/glab/commands/release/releaseutils" "github.com/profclems/glab/internal/config" - "github.com/profclems/glab/internal/glinstance" "github.com/profclems/glab/internal/glrepo" + "github.com/profclems/glab/pkg/glinstance" "github.com/profclems/glab/pkg/iostreams" "github.com/profclems/glab/pkg/utils" "github.com/spf13/cobra" diff --git a/internal/config/config_type.go b/internal/config/config_type.go index ed33045c..b89c609c 100644 --- a/internal/config/config_type.go +++ b/internal/config/config_type.go @@ -7,7 +7,7 @@ import ( "sort" "strings" - "github.com/profclems/glab/internal/glinstance" + "github.com/profclems/glab/pkg/glinstance" "errors" diff --git a/internal/glrepo/repo.go b/internal/glrepo/repo.go index 07e0ab7c..934d0675 100644 --- a/internal/glrepo/repo.go +++ b/internal/glrepo/repo.go @@ -10,8 +10,8 @@ import ( "github.com/profclems/glab/internal/config" - "github.com/profclems/glab/internal/glinstance" "github.com/profclems/glab/pkg/git" + "github.com/profclems/glab/pkg/glinstance" "github.com/profclems/glab/pkg/utils" "github.com/xanzy/go-gitlab" ) diff --git a/internal/glinstance/host.go b/pkg/glinstance/host.go similarity index 100% rename from internal/glinstance/host.go rename to pkg/glinstance/host.go diff --git a/internal/glinstance/host_test.go b/pkg/glinstance/host_test.go similarity index 100% rename from internal/glinstance/host_test.go rename to pkg/glinstance/host_test.go