marwanhawari / stew

🥘 An independent package manager for compiled binaries.
MIT License
193 stars 14 forks source link

Exclude pre-releases from "latest tag" selection in install/upgrade #49

Open HugoDF opened 1 month ago

HugoDF commented 1 month ago

Closes https://github.com/marwanhawari/stew/issues/44.

Detect "pre-release" releases and default to installing/upgrading to the latest non-prerelease version.

Install

Before

./stew install syncthing/syncthing
syncthing/syncthing
⬇️  Downloading asset: 100% |███████████| (11/11 MB, 3.3 MB/s)
✅ Downloaded syncthing-macos-arm64-v1.28.0-rc.3.zip to /Users/hugo/.local/share/stew/pkg

After

./stew install syncthing/syncthing
syncthing/syncthing
⬇️  Downloading asset: 100% |████████████| (10/10 MB, 12 MB/s)
✅ Downloaded syncthing-macos-arm64-v1.27.12.zip to /Users/hugo/.local/share/stew/pkg

Upgrade

Note: syncthing 1.27.12 was installed before running "upgrade"

Before

./stew upgrade syncthing
syncthing
⬇️  Downloading asset: 100% |███████████| (11/11 MB, 9.6 MB/s)
✅ Downloaded syncthing-macos-arm64-v1.28.0-rc.3.zip to /Users/hugo/.local/share/stew/pkg

After

./stew upgrade syncthing
syncthing
Error: The latest tag v1.27.12 is already installed
marwanhawari commented 1 month ago

Awesome, I'll review this over the weekend!