mas-cli / mas-cli/mas

Version pinning / ignoring

Open
#386 2 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Swift
Stars
12.4k
Forks
299
Avg merge
1d 2h
Merged PRs (30d)
1

Description

Notes

Version pinning is a subset of regex version inclusion/exclusion; pinning ignores all updates (potentially at different semver levels), while version inclusion/exclusion could ignore specific versions or version regexes.

Pinning to the current version would exclude .* regex matches; pinning to 1.x would include only 1\..* regex matches.

e.g., as per #668, it looks like apps can report a version in the local install that is different than the version reported in the Mac App Store for the same release (e.g. 1.1.18 vs. 1.0.0.1.18).

To avoid updates being continually offered from 1.1.18 to 1.0.0.1.18, a user might want to ignore version 1.0.0.1.18.

To simplify things, all version inclusion/exclusion should probably be handled by mas pin <app-id> with mutually exclusive options. While "pin" might not exactly properly linguistically apply to all it would handle, it's close enough, while other terms might cause more confusion than they're worth. From here on, "pin" will be a substitute for "version inclusion/exclusion".

mas unpin <app-id> would remove all existing pins for the specified app.

mas pin with no arguments will displays all pins.

mas pin [--force] (<semver-level-name>|<semver-level-index>|--include <regex>|--exclude <regex>) <app-id>

--force would be required to change an existing pin. If a pin exists for <app-id> but --force wasn't supplied, mas will output an error.

mas pin … <app-id> requires one of the following mutually exclusive argument sets:

  • a single <semver-level-name>: e.g., major, minor, patch, prerelease, etc. (I don't know if the Mac App Store supports prerelease versions, or if mas can work with TestFlight)
  • a single <semver-level-index>: if 1-based, 1 = major, 2 = minor, 3 = patch, etc., because version component depth could be arbitrary (could be 0-based, but 1-based is likely better)
    • only apply to dot-separated decimal number components?
    • don't apply to -<prerelease>?
  • --include <regex>: include only versions that fully match <regex>
  • --exclude <regex>: exclude only versions that fully match <regex>

Original Issue

Please add a mechanism to exclude a list of apps from being output or affected by mas outdated or mas upgrade.

Both a command-line option and a file-based config could be useful, the former for one-off exclusion, the latter for ongoing exclusion.

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

The issue names no files or tests. Start by reviewing the existing CLI handling for outdated and upgrade, then trace how app versions are selected and filtered; done means implementing the proposed pin/unpin behavior, mutually exclusive semver or regex options, and persistent or one-off exclusions with appropriate errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, swift
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.