babashka / bbin

Install any Babashka script or project with one command
MIT License
136 stars 9 forks source link

`bbin upgrade [script]` #33

Open rads opened 1 year ago

rads commented 1 year ago

Docs

bbin upgrade [script]

Upgrade a script

# Install from Git tag
$ bbin install io.github.babashka/neil --git/tag v0.1.44
$ neil --version
neil 0.1.44

# Upgrade to latest Git tag
$ bbin upgrade neil
$ neil --version
neil 0.1.45

# Install from HTTP script
$ bbin install https://raw.githubusercontent.com/borkdude/tools/main/antq.clj

# Re-fetch HTTP script
$ bbin upgrade antq

Implementation Details

A non-exhaustive list of examples to consider for upgrading:

{:lib io.github.babashka/neil,
 :coords
 {:git/url "https://github.com/babashka/neil",
  :git/tag "v0.1.45",
  :git/sha "0474d4cb5cfb0207265a4508a0e82ae7a293ab61"}}
{:lib org.babashka/http-server, :coords {:mvn/version "0.1.11"}}
{:coords
  {:bbin/url
   "https://raw.githubusercontent.com/borkdude/tools/main/antq.clj"}}
teodorlu commented 1 year ago

Will it be possible to upgrade all bbin scripts with one command?

rads commented 1 year ago

@teodorlu: Yeah, I was thinking that would be the behavior for bbin upgrade with no arguments, like brew upgrade.

borkdude commented 1 year ago

Maybe an explicit argument would be safer?

teodorlu commented 1 year ago

I would expect bbin upgrade to behave like sudo apt upgrade og pacman -Syuu, where everything is upgraded. Both of those commands take confirmation / ask for sudo.

Are you aware of brew's behavior?