MCPcopy Create free account
hub / github.com/docker/compose / osDependentCacheDir

Function osDependentCacheDir

pkg/remote/cache_windows.go:30–49  ·  view source on GitHub ↗

Based on https://github.com/adrg/xdg Licensed under MIT License (MIT) Copyright (c) 2014 Adrian-George Bostan

()

Source from the content-addressed store, hash-verified

28// Copyright (c) 2014 Adrian-George Bostan <adrg@epistack.com>
29
30func osDependentCacheDir() (string, error) {
31 flags := []uint32{windows.KF_FLAG_DEFAULT, windows.KF_FLAG_DEFAULT_PATH}
32 for _, flag := range flags {
33 p, _ := windows.KnownFolderPath(windows.FOLDERID_LocalAppData, flag|windows.KF_FLAG_DONT_VERIFY)
34 if p != "" {
35 return filepath.Join(p, "cache", "docker-compose"), nil
36 }
37 }
38
39 appData, ok := os.LookupEnv("LOCALAPPDATA")
40 if ok {
41 return filepath.Join(appData, "cache", "docker-compose"), nil
42 }
43
44 home, err := os.UserHomeDir()
45 if err != nil {
46 return "", err
47 }
48 return filepath.Join(home, "AppData", "Local", "cache", "docker-compose"), nil
49}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected