mirror of
https://github.com/kataras/iris.git
synced 2025-12-21 20:07:04 +00:00
able to fetch the ngrok executable path through a 'NGROK' env variable as well, and humanize the returned error
Former-commit-id: 8a61ed64b64e18bd2beb938ccb38150f2090ec54
This commit is contained in:
@@ -461,7 +461,18 @@ func (tc TunnelingConfiguration) startTunnel(t Tunnel, publicAddr *string) error
|
||||
|
||||
if !tc.isNgrokRunning() {
|
||||
ngrokBin := "ngrok" // environment binary.
|
||||
if tc.Bin != "" {
|
||||
|
||||
if tc.Bin == "" {
|
||||
_, err := exec.LookPath(ngrokBin)
|
||||
if err != nil {
|
||||
ngrokEnvVar, found := os.LookupEnv("NGROK")
|
||||
if !found {
|
||||
return fmt.Errorf(`"ngrok" executable not found, please install it from: https://ngrok.com/download`)
|
||||
}
|
||||
|
||||
ngrokBin = ngrokEnvVar
|
||||
}
|
||||
} else {
|
||||
ngrokBin = tc.Bin
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user