Skip to content

Commit

Permalink
use os.Executable to discover the path to cloudflared (#1040)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajvpot authored Dec 14, 2023
1 parent fd5d826 commit f51be82
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/cloudflared/access/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,11 @@ func processURL(s string) (*url.URL, error) {

// cloudflaredPath pulls the full path of cloudflared on disk
func cloudflaredPath() string {
path, err := os.Executable()
if err == nil && isFileThere(path) {
return path
}

for _, p := range strings.Split(os.Getenv("PATH"), ":") {
path := fmt.Sprintf("%s/%s", p, "cloudflared")
if isFileThere(path) {
Expand Down

0 comments on commit f51be82

Please sign in to comment.