ipfs/ipget

`temp` sets up plugins in default path but then it calls tmpNode which creates another ephemeral repo

Closed this issue · 1 comments

ipget/node.go

Lines 77 to 89 in 70497d7

func temp(ctx context.Context) (iface.CoreAPI, error) {
defaultPath, err := config.PathRoot()
if err != nil {
// shouldn't be possible
return nil, err
}
if err := setupPlugins(defaultPath); err != nil {
return nil, err
}
return tmpNode(ctx)
}
sets the plugins on the defaultPath, but then calls tempNode that goes on and creates a repo on a new temporary directory

ipget/node.go

Line 92 in 70497d7

dir, err := ioutil.TempDir("", "ipfs-shell")
.

Doesn't seem right, but I be missing a goism or two :)

Yeah, this is funky. It's loading the plugins from the default repo because there aren't going to be any in the temp repo. Honestly, it doesn't really need to load any plugins from disk.

However, it doesn't really hurt to try to load the user's plugins.