mirror of
https://github.com/ddworken/hishtory.git
synced 2024-11-25 17:53:24 +01:00
mkdir -p but for real
This commit is contained in:
parent
1a74f9792f
commit
09dfaf00fa
@ -84,7 +84,7 @@ func BackupAndRestoreWithId(t *testing.T, id string) func() {
|
||||
func touchFile(p string) {
|
||||
_, err := os.Stat(p)
|
||||
if os.IsNotExist(err) {
|
||||
checkError(os.MkdirAll(filepath.Base(p), os.ModePerm))
|
||||
checkError(os.MkdirAll(filepath.Dir(p), os.ModePerm))
|
||||
file, err := os.Create(p)
|
||||
checkError(err)
|
||||
defer file.Close()
|
||||
|
Loading…
Reference in New Issue
Block a user