DefaultConfigDirectory returns the default directory of the config file
()
| 45 | |
| 46 | // DefaultConfigDirectory returns the default directory of the config file |
| 47 | func DefaultConfigDirectory() string { |
| 48 | if runtime.GOOS == "windows" { |
| 49 | path := os.Getenv("CFDPATH") |
| 50 | if path == "" { |
| 51 | path = filepath.Join(os.Getenv("ProgramFiles(x86)"), "cloudflared") |
| 52 | if _, err := os.Stat(path); os.IsNotExist(err) { // doesn't exist, so return an empty failure string |
| 53 | return "" |
| 54 | } |
| 55 | } |
| 56 | return path |
| 57 | } |
| 58 | return DefaultUnixConfigLocation |
| 59 | } |
| 60 | |
| 61 | // DefaultLogDirectory returns the default directory for log files |
| 62 | func DefaultLogDirectory() string { |
no outgoing calls
no test coverage detected