()
| 249 | } |
| 250 | |
| 251 | func getExecutableOrWorkDir() (string, *FutureLog) { |
| 252 | dir, err := getExecutableDir() |
| 253 | // when using `go run main.go` the executable lives in th temp directory therefore the env.development |
| 254 | // will not be read, this enforces that the current work directory is used in dev mode. |
| 255 | if err != nil || mode.Get() == mode.Dev { |
| 256 | return filepath.Dir("."), err |
| 257 | } |
| 258 | return dir, nil |
| 259 | } |
| 260 | |
| 261 | func getExecutableDir() (string, *FutureLog) { |
| 262 | ex, err := osExecutable() |
no test coverage detected