Skip to content

Commit

Permalink
🐛 move default provider path on macos to /Library/Mondoo (#1841)
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`

Fixes #1832

Signed-off-by: Dominik Richter <[email protected]>
  • Loading branch information
arlimus authored Sep 22, 2023
1 parent 0eae687 commit 52fdbe9
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 52fdbe9

Please sign in to comment.