Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Commit

Permalink
Merge pull request #667 from zemzale/fix-glab-host
Browse files Browse the repository at this point in the history
Fix hostnames resolution
  • Loading branch information
profclems authored Apr 30, 2021
2 parents c443358 + b520c9c commit 3b1a0d5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/glab/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/profclems/glab/internal/glinstance"
"github.com/profclems/glab/internal/run"
"github.com/profclems/glab/pkg/tableprinter"
"github.com/profclems/glab/pkg/utils"

"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -184,6 +185,9 @@ func maybeOverrideDefaultHost(f *cmdutils.Factory) {
glinstance.OverrideDefault(baseRepo.RepoHost())
}
if glHostFromEnv := config.GetFromEnv("host"); glHostFromEnv != "" {
if utils.IsValidURL(glHostFromEnv) {
glHostFromEnv, _ = glinstance.StripHostProtocol(glHostFromEnv)
}
glinstance.OverrideDefault(glHostFromEnv)
}
}

0 comments on commit 3b1a0d5

Please sign in to comment.