1
0
mirror of https://github.com/IceWhaleTech/CasaOS.git synced 2025-07-15 23:54:17 +02:00

Optimize installation process

auto create file or dir
This commit is contained in:
link
2021-10-19 19:07:16 +08:00
parent 8a28d3c589
commit 39ccbe251f
4 changed files with 8 additions and 11 deletions

View File

@ -7,6 +7,7 @@ import (
"encoding/binary"
json2 "encoding/json"
"fmt"
"regexp"
"syscall"
model2 "github.com/IceWhaleTech/CasaOS/service/model"
@ -417,9 +418,10 @@ func (ds *dockerService) DockerContainerCreate(imageName string, containerDbId s
if len(path) == 0 {
continue
}
}
if strings.HasSuffix(path, "/") {
reg1 := regexp.MustCompile(`([^<>/\\\|:""\*\?]+\.\w+$)`)
result1 := reg1.FindAllStringSubmatch(path, -1)
if len(result1) == 0 {
err = file.IsNotExistMkDir(path)
if err != nil {
ds.log.Error("mkdir error", err)