You've already forked CasaOS
mirror of
https://github.com/IceWhaleTech/CasaOS.git
synced 2025-07-06 23:37:26 +02:00
Optimize installation process
auto create file or dir
This commit is contained in:
2
UI
2
UI
Submodule UI updated: 0a78d55a82...645e6cac7d
@ -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)
|
||||
|
@ -84,14 +84,9 @@ func (c *zima) GetDirPath(path string) []model.Path {
|
||||
ls, _ := ioutil.ReadDir(path)
|
||||
dirs := []model.Path{}
|
||||
|
||||
if strings.Count(path, "/") > 1 {
|
||||
if strings.Count(path, "/") > 0 {
|
||||
for _, l := range ls {
|
||||
pathTemp := path + l.Name()
|
||||
if l.IsDir() {
|
||||
pathTemp += "/"
|
||||
}
|
||||
|
||||
dirs = append(dirs, model.Path{Name: l.Name(), Path: pathTemp, IsDir: l.IsDir()})
|
||||
dirs = append(dirs, model.Path{Name: l.Name(), Path: path + "/" + l.Name(), IsDir: l.IsDir()})
|
||||
}
|
||||
} else {
|
||||
dirs = append(dirs, model.Path{Name: "DATA", Path: "/DATA/", IsDir: true})
|
||||
|
@ -1,4 +1,4 @@
|
||||
package types
|
||||
|
||||
const CURRENTVERSION = "0.1.6"
|
||||
const BODY = "<li>Add a file selector for app install.</li> <li>Fixed an issue with the app were it would disappear when the app was modified.</li>"
|
||||
const BODY = "<li>Modify import reminder.</li><li>Add app icon auto-fill via docker image name.</li><li>Add a file selector for app install.</li> <li>Fixed an issue with the app were it would disappear when the app was modified.</li>"
|
||||
|
Reference in New Issue
Block a user