|
@ -28,14 +28,18 @@ func initTMRoot(rootDir string) { |
|
|
rootDir = getTMRoot(rootDir) |
|
|
rootDir = getTMRoot(rootDir) |
|
|
|
|
|
|
|
|
// Remove ~/.tendermint_test_bak
|
|
|
// 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
|
|
|
// 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
|
|
|
// Create new dir
|
|
|
EnsureDir(rootDir, 0700) |
|
|
EnsureDir(rootDir, 0700) |
|
|