feat: 支持多APK与渠道变体,增加自动定位的服务管理CLI
This commit is contained in:
1 parent
7984785610
commit
87652364bc
33 files changed
+1110
-42
No files matched your search
+7
-3
@@ -168,7 +168,7 @@ func (s *Server) validateWorkspace(path string) (string, error) {
|
||||
}
|
||||
}
|
||||
if _, ok := s.containingWorkspaceRoot(path, false); !ok {
|
||||
return "", fmt.Errorf("远程文件夹必须位于管理员允许的根目录内:%s", strings.Join(s.allowedWorkspaceRoots(), ", "))
|
||||
return "", fmt.Errorf("工程目录 %s 未获授权;当前根目录用于容纳工程,请添加其父目录。\n%w", path, s.rootAccessError(filepath.Dir(path)))
|
||||
}
|
||||
// Reject both final and ancestor symlink/junction redirection.
|
||||
for current := path; ; current = filepath.Dir(current) {
|
||||
@@ -206,12 +206,16 @@ func (s *Server) browseDirectories(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if path == "" {
|
||||
if len(roots) == 0 {
|
||||
http.Error(w, s.rootAccessError("<已有工程根目录>").Error(), 400)
|
||||
return
|
||||
}
|
||||
path = roots[0]
|
||||
}
|
||||
path = filepath.Clean(path)
|
||||
root, ok := s.containingWorkspaceRoot(path, true)
|
||||
if !ok {
|
||||
http.Error(w, "目录超出管理员允许的根目录", 400)
|
||||
http.Error(w, s.rootAccessError(path).Error(), 400)
|
||||
return
|
||||
}
|
||||
rel, _ := filepath.Rel(root, path)
|
||||
@@ -222,7 +226,7 @@ func (s *Server) browseDirectories(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
entries, e := os.ReadDir(path)
|
||||
if e != nil {
|
||||
http.Error(w, "服务账户无法读取该目录", 400)
|
||||
http.Error(w, "服务账户无法读取该目录\n"+permissionGuidance(path), 400)
|
||||
return
|
||||
}
|
||||
dirs := []map[string]string{}
|
||||
|
||||
Reference in new issue
Block a user