File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -16,15 +16,16 @@ func GetDcc32DirByCmd() []string {
16
16
17
17
outputStr := strings .ReplaceAll (string (output ), "\t " , "" )
18
18
outputStr = strings .ReplaceAll (outputStr , "\r " , "" )
19
- outputStr = strings .ReplaceAll (outputStr , "\n " , "" )
20
19
21
- if len (outputStr ) == 0 {
20
+ if len (strings . ReplaceAll ( outputStr , " \n " , "" ) ) == 0 {
22
21
return []string {}
23
22
}
24
23
25
- installations := strings .Split (outputStr , "\n " )
26
- for key , value := range installations {
27
- installations [key ] = filepath .Dir (value )
24
+ installations := []string {}
25
+ for _ , value := range strings .Split (outputStr , "\n " ) {
26
+ if len (strings .TrimSpace (value )) > 0 {
27
+ installations = append (installations , filepath .Dir (value ))
28
+ }
28
29
}
29
30
30
31
return installations
You can’t perform that action at this time.
0 commit comments