Skip to content

Commit

Permalink
Merge pull request #371 from ipfs-force-community/chore/add_repo_envVars
Browse files Browse the repository at this point in the history
chore: add repo evn var
  • Loading branch information
LinZexiao authored Dec 6, 2023
2 parents a254162 + 8808a2d commit 25bcd17
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions cli/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
v1 "github.com/filecoin-project/venus/venus-shared/api/chain/v1"
"github.com/filecoin-project/venus/venus-shared/utils"
"github.com/ipfs-force-community/sophon-messager/filestore"
logging "github.com/ipfs/go-log/v2"
"github.com/mitchellh/go-homedir"
"github.com/urfave/cli/v2"

Expand All @@ -23,6 +24,8 @@ const (
DefRepoPath = "~/.sophon-messager"
)

var log = logging.Logger("cli")

func getAPI(ctx *cli.Context) (messager.IMessager, jsonrpc.ClientCloser, error) {
repo, err := getRepo(ctx)
if err != nil {
Expand Down Expand Up @@ -85,6 +88,7 @@ func GetRepoPath(cctx *cli.Context) (string, error) {
if err != nil {
return "", err
}
log.Info("repo path: ", repoPath)
has, err := hasFSRepo(repoPath)
if err != nil {
return "", err
Expand Down
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ func main() {
Usage: "used for manage message",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: ccli.DefRepoPath,
Name: "repo",
Value: ccli.DefRepoPath,
EnvVars: []string{"SOPHON_MESSAGER_PATH"},
},
},
Commands: []*cli.Command{
Expand Down

0 comments on commit 25bcd17

Please sign in to comment.