use os.Executable to discover the path to cloudflared (#1040)
This commit is contained in:
parent
fd5d8260bb
commit
f51be82729
|
@ -478,6 +478,11 @@ func processURL(s string) (*url.URL, error) {
|
||||||
|
|
||||||
// cloudflaredPath pulls the full path of cloudflared on disk
|
// cloudflaredPath pulls the full path of cloudflared on disk
|
||||||
func cloudflaredPath() string {
|
func cloudflaredPath() string {
|
||||||
|
path, err := os.Executable()
|
||||||
|
if err == nil && isFileThere(path) {
|
||||||
|
return path
|
||||||
|
}
|
||||||
|
|
||||||
for _, p := range strings.Split(os.Getenv("PATH"), ":") {
|
for _, p := range strings.Split(os.Getenv("PATH"), ":") {
|
||||||
path := fmt.Sprintf("%s/%s", p, "cloudflared")
|
path := fmt.Sprintf("%s/%s", p, "cloudflared")
|
||||||
if isFileThere(path) {
|
if isFileThere(path) {
|
||||||
|
|
Loading…
Reference in New Issue