File tree Expand file tree Collapse file tree 1 file changed +10
-19
lines changed
Expand file tree Collapse file tree 1 file changed +10
-19
lines changed Original file line number Diff line number Diff line change @@ -49,24 +49,15 @@ func main() {
4949
5050 withNodeModules (& cacheDirs )
5151
52- cacheDirsLen := len (cacheDirs )
53-
54- pass , _ , wait := NoopPromise (cacheDirsLen )
55- for _ , v := range cacheDirs {
56- go func (dir string ) {
57- if ! IsExist (dir ) || ! IsDir (dir ) {
58- pass ()
59- return
60- }
61- err := RemoveAll (dir )
62- if err != nil {
63- color .Red ("remove fail: %v \n root: %v" , err , dir )
64- pass () // 错误时直接跳过即可,不需要 cry
65- } else {
66- color .Green ("remove success: %v" , dir )
67- pass ()
68- }
69- }(v )
52+ for _ , dir := range cacheDirs {
53+ if ! IsExist (dir ) || ! IsDir (dir ) {
54+ continue
55+ }
56+ err := RemoveAll (dir )
57+ if err != nil {
58+ color .Red ("remove fail: %v \n root: %v" , err , dir )
59+ } else {
60+ color .Green ("remove success: %v" , dir )
61+ }
7062 }
71- wait ()
7263}
You can’t perform that action at this time.
0 commit comments