mkdir .go-ipfs bugfix
Juan Batiz-Benet committed
Aug 20, 2014 at 18:26 UTC
c1ae1d2ad4e146cc83976cd1cd705bd73bb1e341
1 file changed
+6
config/serialize.go
+6
@@ -5,6 +5,7 @@ import (
5
"fmt"
6
"io"
7
"os"
8
+ "path/filepath"
9
"strings"
10
)
11
@@ -32,6 +33,11 @@ func WriteConfigFile(filename string, cfg interface{}) error {
33
34
// WriteFile writes the buffer at filename
35
func WriteFile(filename string, buf []byte) error {
36
+ err := os.MkdirAll(filepath.Dir(filename), 755)
37
+ if err != nil {
38
+ return err
39
+ }
40
+
41
f, err := os.Create(filename)
42
if err != nil {
43
return err