Skip to content

Commit

Permalink
fix delphi directory retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
FLuzzi-csw committed Mar 7, 2024
1 parent c7b74f5 commit 13c7d50
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions utils/dcc32/dcc32.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ func GetDcc32DirByCmd() []string {

outputStr := strings.ReplaceAll(string(output), "\t", "")
outputStr = strings.ReplaceAll(outputStr, "\r", "")
outputStr = strings.ReplaceAll(outputStr, "\n", "")

if len(outputStr) == 0 {
if len(strings.ReplaceAll(outputStr, "\n", "")) == 0 {
return []string{}
}

installations := strings.Split(outputStr, "\n")
for key, value := range installations {
installations[key] = filepath.Dir(value)
installations := []string{}
for _, value := range strings.Split(outputStr, "\n") {
if len(strings.TrimSpace(value)) > 0 {
installations = append(installations, filepath.Dir(value))
}
}

return installations
Expand Down

0 comments on commit 13c7d50

Please sign in to comment.