Skip to content

[FR] hide older macOS versions when using --select #578

@Uggbert

Description

@Uggbert

SInce you cannot downgrade macOS I was looking for a way to alter the select_build_from_dialog() function and specifically the version_list() array

I got this to work and was wondering if someone with much greater knowlege of scripting/erase-install could sanity check it
after 1904

IFS=$'\n'
    filtered_versions=()
    for entry in ${version_list[@]} ; do
        # Grab the version number only for comparison
        version_check="${entry%% *}"
        # If version is not equal to the system version AND is greater than the system version
        if [[ "$version_check" != "$system_version" ]] && [[ "$(printf '%s\n' "$version_check" "$system_version" | sort -V | head -n1)" == "$system_version" ]]; then
                filtered_versions+=("$entry")
        fi
    done
    version_list=()
    version_list=("${filtered_versions[@]}")

before 1905

result:

Image

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions