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

Add "pre-Catalina" support #15

Merged
merged 2 commits into from
Jan 9, 2024
Merged

Add "pre-Catalina" support #15

merged 2 commits into from
Jan 9, 2024

Conversation

jetfir3
Copy link
Contributor

@jetfir3 jetfir3 commented Jan 1, 2024

  • fall back to regex to pull serial_number and platform_UUID output from system_profiler if -json option is not supported
  • use macOS 11 runner to build for x86_64 to support macOS 10.14+ (and earlier?)

This PR coincides with:

macOS 10.14.x and earlier do not support the -json flag when using system_profiler so switching to -xml and grabbing serial and UUID with regex has worked for me on 10.14.6. Additionally, when building the binary with macOS 13, the binary will not execute on macOS 10.14.x (and earlier) -- building on macOS 11 resolves this and does not cause any issues with current macOS builds that I am aware of.

Parsing XML in Go was bothersome... though perhaps may be the more "proper" solution instead of regex. Alternatively, ioreg can be used to grab both serial and uuid:

  • ioreg -c IOPlatformExpertDevice -d 2 | awk -F\" '/IOPlatformSerialNumber/{print $(NF-1)}'
  • ioreg -c IOPlatformExpertDevice -d 2 | awk -F\" '/IOPlatformUUID/{print $(NF-1)}'

- fall back to regex to pull serial_number and platform_UUID output from system_profiler if -json option is not supported
- use macOS 11 runner to build for x86_64 to support macOS 10.14+ (and earlier?)
@0xdevalias
Copy link
Contributor

Supercedes:

@tulir tulir merged commit 4655c24 into beeper:main Jan 9, 2024
1 check passed
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.

3 participants