mkdir -p but for real

This commit is contained in:
David Dworken 2022-09-18 21:05:51 -07:00
parent 1a74f9792f
commit 09dfaf00fa

View File

@ -84,7 +84,7 @@ func BackupAndRestoreWithId(t *testing.T, id string) func() {
func touchFile(p string) { func touchFile(p string) {
_, err := os.Stat(p) _, err := os.Stat(p)
if os.IsNotExist(err) { 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) file, err := os.Create(p)
checkError(err) checkError(err)
defer file.Close() defer file.Close()