From d6aa43fcda82114bb3886c71c2684dba864c83ee Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Fri, 22 Jan 2016 11:55:24 -0800 Subject: [PATCH] Fix broken test due to config requiring ~/.tendermint_test --- config/tendermint_test/config.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/config/tendermint_test/config.go b/config/tendermint_test/config.go index 12bf36699..a2c5570e3 100644 --- a/config/tendermint_test/config.go +++ b/config/tendermint_test/config.go @@ -28,14 +28,18 @@ func initTMRoot(rootDir string) { rootDir = getTMRoot(rootDir) // Remove ~/.tendermint_test_bak - err := os.RemoveAll(rootDir + "_bak") - if err != nil { - PanicSanity(err.Error()) + if FileExists(rootDir + "_bak") { + err := os.RemoveAll(rootDir + "_bak") + if err != nil { + PanicSanity(err.Error()) + } } // Move ~/.tendermint_test to ~/.tendermint_test_bak - err = os.Rename(rootDir, rootDir+"_bak") - if err != nil { - PanicSanity(err.Error()) + if FileExists(rootDir + "_bak") { + err := os.Rename(rootDir, rootDir+"_bak") + if err != nil { + PanicSanity(err.Error()) + } } // Create new dir EnsureDir(rootDir, 0700)