mirror of
https://github.com/nicksherron/bashhub-server.git
synced 2025-11-12 06:40:53 +08:00
cmd/root: fix checkBhEnv message
This commit is contained in:
parent
f648fd9ae4
commit
2cd06fc874
1 changed files with 4 additions and 5 deletions
|
|
@ -87,8 +87,8 @@ func startupMessage() {
|
||||||
|
|
||||||
func listenAddr() string {
|
func listenAddr() string {
|
||||||
var a string
|
var a string
|
||||||
if os.Getenv("BH_URL") != "" {
|
if os.Getenv("BH_SERVER_URL") != "" {
|
||||||
a = os.Getenv("BH_URL")
|
a = os.Getenv("BH_SERVER_URL")
|
||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
a = "http://0.0.0.0:8080"
|
a = "http://0.0.0.0:8080"
|
||||||
|
|
@ -117,13 +117,12 @@ func appDir() string {
|
||||||
return ch
|
return ch
|
||||||
}
|
}
|
||||||
func checkBhEnv() {
|
func checkBhEnv() {
|
||||||
addr := strings.ReplaceAll(internal.Addr, "http://", "")
|
|
||||||
bhURL := os.Getenv("BH_URL")
|
bhURL := os.Getenv("BH_URL")
|
||||||
if strings.Contains(bhURL, "https://bashhub.com") {
|
if strings.Contains(bhURL, "https://bashhub.com") {
|
||||||
msg := fmt.Sprintf(`
|
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
|
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")
|
fmt.Println(msg, "\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue