Skip to content

Commit

Permalink
cmd/root: fix checkBhEnv message
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksherron committed Feb 10, 2020
1 parent f648fd9 commit 2cd06fc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ func startupMessage() {

func listenAddr() string {
var a string
if os.Getenv("BH_URL") != "" {
a = os.Getenv("BH_URL")
if os.Getenv("BH_SERVER_URL") != "" {
a = os.Getenv("BH_SERVER_URL")
return a
}
a = "http://0.0.0.0:8080"
Expand Down Expand Up @@ -117,13 +117,12 @@ func appDir() string {
return ch
}
func checkBhEnv() {
addr := strings.ReplaceAll(internal.Addr, "http://", "")
bhURL := os.Getenv("BH_URL")
if strings.Contains(bhURL, "https://bashhub.com") {
msg := fmt.Sprintf(`
WARNING: BH_URL is to https://bashhub.com on this machine
WARNING: BH_URL is set to https://bashhub.com on this machine
If you will be running bashhub-client locally be sure to add
export BH_URL=%v to your .bashrc or .zshrc`, addr)
export BH_URL=%v to your .bashrc or .zshrc`, internal.Addr)
fmt.Println(msg, "\n")
}
}

0 comments on commit 2cd06fc

Please sign in to comment.