MCPcopy Create free account
hub / github.com/dolthub/doltgresql / dbInitCreateAuthDirectory

Function dbInitCreateAuthDirectory

server/auth/database.go:197–211  ·  view source on GitHub ↗

dbInitCreateAuthDirectory creates the directory structure pointed to by the auth file if it does not already exist.

(authFileName string)

Source from the content-addressed store, hash-verified

195
196// dbInitCreateAuthDirectory creates the directory structure pointed to by the auth file if it does not already exist.
197func dbInitCreateAuthDirectory(authFileName string) error {
198 dir, _ := filepath.Split(authFileName)
199 // If there's no directory, then we have nothing to create
200 if len(dir) == 0 {
201 return nil
202 }
203 fullDir, err := fileSystem.Abs(dir)
204 if err != nil {
205 return err
206 }
207 if exists, _ := fileSystem.Exists(fullDir); !exists {
208 return fileSystem.MkDirs(fullDir)
209 }
210 return nil
211}

Callers 1

dbInitFunction · 0.85

Calls 1

ExistsMethod · 0.65

Tested by

no test coverage detected