Skip to content

Commit

Permalink
🐛 move default provider path on macos to /Library/Mondoo
Browse files Browse the repository at this point in the history
Add special handling for MacOS / Darwin and make sure all configs + providers are in the same shared directory `/Library/Mondoo`

Signed-off-by: Dominik Richter <[email protected]>
  • Loading branch information
arlimus committed Sep 22, 2023
1 parent 0eae687 commit 72b05cf
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions cli/config/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,18 @@ func systemPath(isConfig bool, childPath ...string) string {
var parts []string
if runtime.GOOS == "windows" {
parts = append([]string{`C:\ProgramData\Mondoo\`}, childPath...)
} else if isConfig {
parts = append([]string{"/etc", "opt", "mondoo"}, childPath...)
} else if runtime.GOOS == "darwin" {
if isConfig {
parts = append([]string{"/Library", "Mondoo", "etc"}, childPath...)
} else {
parts = append([]string{"/Library", "Mondoo"}, childPath...)
}
} else {
parts = append([]string{"/opt", "mondoo"}, childPath...)
if isConfig {
parts = append([]string{"/etc", "opt", "mondoo"}, childPath...)
} else {
parts = append([]string{"/opt", "mondoo"}, childPath...)
}
}

systemConfig := filepath.Join(parts...)
Expand Down

0 comments on commit 72b05cf

Please sign in to comment.