mas-cli / mas-cli/mas

Download script for portable installation

Open
#385 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the solution you'd like

Distributing official download.sh in the repository. Or it could be install.sh that take --target as parameter and copies the executable binary on a desired place.

So the end users can run something like /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/mas-cli/mas/HEAD/script/download.sh)" to get right mas binary on current folder. Just like brew.

The script would:

  1. Find right URL for latest release from /releases like https://github.com/mas-cli/mas/releases/download/v1.8.2/mas-1.8.2.arm64_big_sur.bottle.tar.gz for the currrent OS.
    • It would include finding major OS name (big sur, el capitan, high sierra etc.) and detecting current CPU architecture (arm64 or not). Just like in bottle.sh (maybe they can reuse the same logic?)
  2. Download the archive on a local folder

I think steps above are good enough but would be nice to have with more steps in the script:

  1. Extract the .tar.gz
  2. Make the mas binary executable (chmod +ux mas)
  3. Remove unsigned application warning (xattr -r -d com.apple.quarantine './mas')
  4. 🥳 A portable mas binary is ready to go!
Background

It's awesome that the portable edition is being distributed with mas now.

However automatically installing the right binary major version / CPU architecture is complex without any package manager, requiring some unofficial logic. The downside of consumers having their "own" script is the risk of compatibility issues with future releases of mas e.g. when a new OS platform is supported.

Providing a way to download right portable binary in an easy way for current OS would make it easy to use in automated scripts that are massively distributed. Because it would enable distributing mas without requiring a package manager or any installation in a most lightweight way possible. So consuming scripts can be non-intrusive to users' potential existing installation nor require an uninstallation logic (would simply delete the binary)

(I'd love to distribute and use mas in privacy.sexy in a reliable an future proof way to many clients. This feature request is extension of #326 where pkg solution is also discussed but it does not seem to be friendly way of distributing portable application)

Looking forward for your feedback about whether it's worth considering.

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

Start by reading script/bottle and inspecting the release assets referenced in the issue to understand existing OS and CPU detection. A completed change would provide an official download.sh or install.sh that selects the current macOS binary, downloads and extracts it, sets executable permissions, and removes the quarantine attribute.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, macos
Domain
cli, release
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.