Skip to content

Commit 7f295d3

Browse files
committed
expand ~ into the home directory for IPFS_PATH
1 parent a281eca commit 7f295d3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ var migrations = []gomigrate.Migration{
4242
func GetIpfsDir() (string, error) {
4343
ipfspath := os.Getenv("IPFS_PATH")
4444
if ipfspath != "" {
45-
return ipfspath, nil
45+
expandedPath, err := homedir.Expand(ipfspath)
46+
if err != nil {
47+
return "", err
48+
}
49+
return expandedPath, nil
4650
}
4751

4852
home, err := homedir.Dir()

0 commit comments

Comments
 (0)