MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / handleExpansion

Function handleExpansion

agent/utils/files/fileinfo.go:207–217  ·  view source on GitHub ↗
(file *FileInfo, op FileOption)

Source from the content-addressed store, hash-verified

205}
206
207func handleExpansion(file *FileInfo, op FileOption) error {
208 if file.IsDir {
209 return file.listChildren(op)
210 }
211
212 if !file.IsDetail {
213 return file.getContent()
214 }
215
216 return nil
217}
218
219func (f *FileInfo) search(search string, count int) (files []FileSearchInfo, total int, err error) {
220 cmd := exec.Command("find", f.Path, "-name", fmt.Sprintf("*%s*", search))

Callers 1

NewFileInfoFunction · 0.85

Calls 2

listChildrenMethod · 0.80
getContentMethod · 0.80

Tested by

no test coverage detected