mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-20 03:47:54 +02:00
mkdir -p
This commit is contained in:
parent
0792a5665c
commit
1a74f9792f
@ -9,6 +9,7 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
@ -83,6 +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))
|
||||
file, err := os.Create(p)
|
||||
checkError(err)
|
||||
defer file.Close()
|
||||
|
Loading…
x
Reference in New Issue
Block a user