MCPcopy Index your code
hub / github.com/screego/server / getExecutableOrWorkDir

Function getExecutableOrWorkDir

config/config.go:251–259  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

249}
250
251func 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
261func getExecutableDir() (string, *FutureLog) {
262 ex, err := osExecutable()

Callers 1

GetFunction · 0.85

Calls 2

GetFunction · 0.92
getExecutableDirFunction · 0.85

Tested by

no test coverage detected