From 86a7791e27997524e964baa8332428ee663688b2 Mon Sep 17 00:00:00 2001 From: tnasu Date: Sat, 15 Jul 2023 00:41:34 +0900 Subject: [PATCH] (fixup) Change to OCHOME and improve tests --- cmd/ostracon/commands/reset_test.go | 1 + cmd/ostracon/commands/root.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/ostracon/commands/reset_test.go b/cmd/ostracon/commands/reset_test.go index e0bec94a3..90a42dee4 100644 --- a/cmd/ostracon/commands/reset_test.go +++ b/cmd/ostracon/commands/reset_test.go @@ -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 } diff --git a/cmd/ostracon/commands/root.go b/cmd/ostracon/commands/root.go index d00341d19..44a340a57 100644 --- a/cmd/ostracon/commands/root.go +++ b/cmd/ostracon/commands/root.go @@ -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 {