mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-20 11:57:50 +02:00
mkdir -p
This commit is contained in:
parent
0792a5665c
commit
1a74f9792f
@ -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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user