MCPcopy Create free account
hub / github.com/OpenAtomFoundation/SmartIDE / folderEmpty

Function folderEmpty

cli/cmd/new/newLocal.go:122–139  ·  view source on GitHub ↗

判断文件夹是坦为空 空为true

(dirPth string)

Source from the content-addressed store, hash-verified

120// 判断文件夹是坦为空
121// 空为true
122func folderEmpty(dirPth string) (bool, error) {
123 fis, err := os.ReadDir(dirPth)
124 if err != nil {
125 return false, err
126 }
127
128 isEmpty := true
129 for _, f := range fis {
130 if !f.IsDir() && runtime.GOOS == "darwin" && strings.Contains(f.Name(), ".DS_Store") {
131 continue
132 }
133
134 isEmpty = false
135 break
136 }
137
138 return isEmpty, nil
139}
140
141/**
142 * 拷贝文件夹,同时拷贝文件夹中的文件

Callers 1

LocalNewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected