diff --git a/settings.go b/settings.go index 2301e22..7b1af07 100644 --- a/settings.go +++ b/settings.go @@ -76,13 +76,6 @@ func random(n int) string { return string(b) } -// Wdir return the current working directory -func (s Settings) wdir() string { - dir, err := os.Getwd() - s.validate(err) - return filepath.Base(dir) -} - // Flimit defines the max number of watched files func (s *Settings) flimit() error { var rLimit syscall.Rlimit diff --git a/utils.go b/utils.go index 4025f79..79c94d8 100644 --- a/utils.go +++ b/utils.go @@ -6,6 +6,7 @@ import ( "os" "path/filepath" "strings" + "log" ) // getEnvPath returns the first path found in env or empty string @@ -83,3 +84,12 @@ func replace(a []string, b string) []string { } return a } + +// Wdir return current working directory +func wdir() string { + dir, err := os.Getwd() + if err != nil { + log.Fatal(prefix(err.Error())) + } + return dir +}