mirror of
https://github.com/fluencelabs/tendermint
synced 2025-07-31 20:21:56 +00:00
improved barak with logging into ~/.barak/outputs
This commit is contained in:
10
common/os.go
10
common/os.go
@@ -50,3 +50,13 @@ func AtomicWriteFile(filePath string, newBytes []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func EnsureDir(dir string) error {
|
||||
if _, err := os.Stat(dir); os.IsNotExist(err) {
|
||||
err := os.MkdirAll(dir, 0700)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Could not create directory %v. %v", dir, err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user