Use sw_vers -productVersion to discover the macOS version
Open
Nobody has claimed this yet.
Status: Untriaged
Type: Bug
- Dominant language
- Ruby
- Stars
- 13
- Forks
- 55
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 8
Description
We're currently using an overly complex method of detecting the platform version:
platform_version=`sw_vers | awk '/^ProductVersion:/ { print $2 }' | cut -d. -f1,2`
At least on 10.15 this can be done without the need for awk. We should figure out if older versions of macOS include this flag:
platform_version=`sw_vers -productVersion | cut -d. -f1,2`
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Find the current platform-version detection that runs the shown sw_vers pipeline, then check whether sw_vers -productVersion is supported by the older macOS versions this project targets. Replace the overly complex lookup only if that compatibility check passes, and verify the existing platform-version behavior remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- operating-systems
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100