chef / chef/mixlib-install

Use sw_vers -productVersion to discover the macOS version

Open
#312 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.