From a187b50382b8ee14ce4a076ff42aa23748f0751b Mon Sep 17 00:00:00 2001 From: Janison Sivarajah Date: Wed, 2 Dec 2020 19:26:28 -0500 Subject: [PATCH] Hotfix/ipfsaddr vars (#275) * Hotfix: use string for main var and add to makefile * Hotfix: add ipfs_addr to CI vars. * Hotfix: prefix ipfs path with homedir so we don't to pass ~ into CI. --- core/ipfs/node/node.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/ipfs/node/node.go b/core/ipfs/node/node.go index aa0353a3..c7864d73 100644 --- a/core/ipfs/node/node.go +++ b/core/ipfs/node/node.go @@ -6,6 +6,8 @@ import ( "github.com/FleekHQ/space-daemon/config" "github.com/FleekHQ/space-daemon/log" + "os/user" + "fmt" "io/ioutil" "path/filepath" @@ -85,6 +87,13 @@ func (node *IpfsNode) start() error { repoPath := node.cfg.GetString(config.Ipfsnodepath, pathRoot) if repoPath == "" { repoPath = pathRoot + } else { + usr, err := user.Current() + if err != nil { + repoPath = pathRoot + } else { + repoPath = filepath.Join(usr.HomeDir, repoPath) + } } if err := setupPlugins(repoPath); err != nil {