babashka / neil

A CLI to add common aliases and features to deps.edn-based projects
MIT License
377 stars 27 forks source link

`neil version patch`: Improve `SNAPSHOT` version handling #145

Open rads opened 1 year ago

rads commented 1 year ago

When using neil version patch with versions ending with -SNAPSHOT, the version should have its suffix removed but not incremented. It's useful to set the :neil :project :version to a snapshot to make it obvious that the current build is a pre-release version until the final patch version is released.

Example use case:

$ bbin install io.github.babashka/bbin --latest-sha --as bbin-dev
{:coords
 #:git{:url "https://github.com/babashka/bbin.git",
       :sha "5a1076e589724e52071d3ec9ce8ea1627ebcfe8e"},
 :lib io.github.babashka/bbin}

$ bbin --version
bbin 0.1.8

$ bbin-dev --version
bbin 0.1.9-SNAPSHOT

Current behavior:

$ cat deps.edn
{:aliases {:neil {:project {:version "0.0.1-SNAPSHOT"}}}}

$ neil version patch
v0.0.2

Expected behavior:

$ cat deps.edn
{:aliases {:neil {:project {:version "0.0.1-SNAPSHOT"}}}}

$ neil version patch
v0.0.1