Browse Source

Fix broken test due to config requiring ~/.tendermint_test

pull/192/head
Jae Kwon 9 years ago
parent
commit
d6aa43fcda
1 changed files with 10 additions and 6 deletions
  1. +10
    -6
      config/tendermint_test/config.go

+ 10
- 6
config/tendermint_test/config.go View File

@ -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)


Loading…
Cancel
Save