Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Use xml with system_profiler#14

Closed
jetfir3 wants to merge 5 commits intobeeper:mainfrom
jetfir3:xml
Closed

Use xml with system_profiler#14
jetfir3 wants to merge 5 commits intobeeper:mainfrom
jetfir3:xml

Conversation

@jetfir3
Copy link
Copy Markdown
Contributor

@jetfir3 jetfir3 commented Dec 30, 2023

  • fallback to -xml if macOS version does not include -json

This fixes issues on macOS 10.14.x (Mojave) and earlier as system_profiler does not offer -json option until 10.15.x (Catalina).

I would assume usage on 10.14.x and earlier will be less than 10.15.x so I thought it'd be best to leave the json parsing in rather than switch entirely to xml. Could also have conditions depending on macOS version detected but current method in this PR seemed more straightforward.

@jetfir3 jetfir3 closed this Dec 31, 2023
@jetfir3 jetfir3 deleted the xml branch December 31, 2023 19:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant