From 2cd06fc874c2717f78aed65a805891599c0eed86 Mon Sep 17 00:00:00 2001 From: nicksherron Date: Mon, 10 Feb 2020 04:37:41 -0500 Subject: [PATCH] cmd/root: fix checkBhEnv message --- cmd/root.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 45bf999..9eb97d3 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -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" @@ -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") } }