1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-06 11:31:54 +08:00
Files
kubo/repo/fsrepo/misc.go
Steven Allen 0252710020 remove Godeps
fixes #2722

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-09-11 12:11:24 -07:00

24 lines
619 B
Go

package fsrepo
import (
"os"
config "gx/ipfs/QmYVqYJTVjetcf1guieEgWpK1PZtHPytP624vKzTF1P3r2/go-ipfs-config"
homedir "gx/ipfs/QmdcULN1WCzgoQmcCaUAmEhwcxHYsDrbZ2LvRJKCL8dMrK/go-homedir"
)
// BestKnownPath returns the best known fsrepo path. If the ENV override is
// present, this function returns that value. Otherwise, it returns the default
// repo path.
func BestKnownPath() (string, error) {
ipfsPath := config.DefaultPathRoot
if os.Getenv(config.EnvDir) != "" {
ipfsPath = os.Getenv(config.EnvDir)
}
ipfsPath, err := homedir.Expand(ipfsPath)
if err != nil {
return "", err
}
return ipfsPath, nil
}