This commit is contained in:
David Dworken 2022-09-18 19:20:21 -07:00
parent 0792a5665c
commit 1a74f9792f

View File

@ -9,6 +9,7 @@ import (
"os" "os"
"os/exec" "os/exec"
"path" "path"
"path/filepath"
"runtime" "runtime"
"strings" "strings"
"testing" "testing"
@ -83,6 +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))
file, err := os.Create(p) file, err := os.Create(p)
checkError(err) checkError(err)
defer file.Close() defer file.Close()