mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 18:37:45 +08:00
mkdir .go-ipfs bugfix
This commit is contained in:
parent
9b06ad53bd
commit
c1ae1d2ad4
@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@ -32,6 +33,11 @@ func WriteConfigFile(filename string, cfg interface{}) error {
|
||||
|
||||
// WriteFile writes the buffer at filename
|
||||
func WriteFile(filename string, buf []byte) error {
|
||||
err := os.MkdirAll(filepath.Dir(filename), 755)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
f, err := os.Create(filename)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Loading…
Reference in New Issue
Block a user