Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use xml with system_profiler #14

Closed
wants to merge 5 commits into from
Closed

Use xml with system_profiler #14

wants to merge 5 commits into from

Conversation

jetfir3
Copy link
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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant