marwanhawari / stew

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

Batch compatible install #20

Closed cardil closed 7 months ago

cardil commented 1 year ago

The install command should be batch-compatible. Currently, it asks ! Rename the binary?, which prevents automation, and batch usage.

One way to fix this may be a --rename (or --as) option for install command:

$ stew install knative-sandbox/kn-plugin-event --as kn-event
knative-sandbox/kn-plugin-event
⬇️  Downloading asset: 100% |██████████████████████████████████████████████████████████| (57/57 MB, 34.474 MB/s)        
✅ Downloaded kn-event-linux-amd64 to /home/ksuszyns/.local/share/stew/pkg
📄 Updated /home/ksuszyns/.local/share/stew/Stewfile.lock.json
✨ Successfully installed the kn-event binary in /home/ksuszyns/bin

Alternative, could be a format of the installation. For example:

$ stew install knative-sandbox/kn-plugin-event!kn-event
marwanhawari commented 7 months ago

This is addressed by the new ability to have reproducible batch installs from the Stewfile.lock.json (https://github.com/marwanhawari/stew/pull/15, https://github.com/marwanhawari/stew/pull/35, https://github.com/marwanhawari/stew/pull/42, https://github.com/marwanhawari/stew/pull/43). This was a part of the v0.4.0 release.

I decided to make the Stewfile.lock.json the mechanism for these batch installs rather than the Stewfile. Stewfiles are nice for passing around machines with different OS/Arch's, but for reproducible, headless batch installs, users should use the lockfile.