Skip to content

Commit

Permalink
(fixup) Change to OCHOME and improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tnasu committed Jul 19, 2023
1 parent 8956497 commit 86a7791
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions cmd/ostracon/commands/reset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func setupEnv(t *testing.T) string {
viper.SetEnvPrefix("OC")
require.NoError(t, viper.BindEnv("HOME"))
require.NoError(t, os.Setenv("OC_HOME", rootDir))
require.NoError(t, os.Setenv("OCHOME", rootDir))
return rootDir
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/ostracon/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ func ParseConfig(cmd *cobra.Command) (*cfg.Config, error) {
}

var home string
if os.Getenv("TMHOME") != "" {
home = os.Getenv("TMHOME")
if os.Getenv("OCHOME") != "" {
home = os.Getenv("OCHOME")
} else {
home, err = cmd.Flags().GetString(cli.HomeFlag)
if err != nil {
Expand Down

0 comments on commit 86a7791

Please sign in to comment.