Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix homedir expansion #1231

Merged
merged 2 commits into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cmd/boost/retrieve_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
flatfs "github.com/ipfs/go-ds-flatfs"
levelds "github.com/ipfs/go-ds-leveldb"
blockstore "github.com/ipfs/go-ipfs-blockstore"
"github.com/mitchellh/go-homedir"

"github.com/dustin/go-humanize"
clinode "github.com/filecoin-project/boost/cli/node"
Expand Down Expand Up @@ -85,6 +86,12 @@ var retrieveCmd = &cli.Command{
}

cfgdir := cctx.String(cmd.FlagRepo.Name)

cfgdir, err = homedir.Expand(cfgdir)
if err != nil {
return fmt.Errorf("expanding homedir: %w", err)
}

node, err := clinode.Setup(cfgdir)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cfgdir is expanded within clinode.Setup, but it is also currently used in non-expanded form further down in this function at:

fc, err := rc.NewClient(node.Host, api, node.Wallet, addr, bstore, ds, cfgdir)


So this PR is expanding the cfgdir immediately when we get it from the flag.

if err != nil {
return fmt.Errorf("setting up CLI node: %w", err)
Expand Down
3 changes: 2 additions & 1 deletion node/config/doc_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.