adamralph/minver

2.4.0 release

adamralph opened this issue · 2 comments

@adamralph I tested the usage of environment variables with minver-cli 2.4.0-beta.2 and it all works as expected.

minver-cli uses environment variables when present

Environment variable Case-insensitive
MinVerAutoIncrement MINVERAUTOINCREMENT
MinVerBuildMetadata MINVERBUILDMETADATA
MinVerDefaultPreReleasePhase MINVERDEFAULTPRERELEASEPHASE
MinVerMinimumMajorMinor MINVERMINIMUMMAJORMINOR
MinVerTagPrefix MINVERTAGPREFIX
MinVerVerbosity MINVERVERBOSITY
MinVerVersionOverride MINVERVERSIONOVERRIDE

minver-cli command-line arguments override environment variables when present

Environment variable Command-line argument
MinVerAutoIncrement --auto-increment
MinVerBuildMetadata --build-metadata
MinVerDefaultPreReleasePhase --default-pre-release-phase
MinVerMinimumMajorMinor --minimum-major-minor
MinVerTagPrefix --tag-prefix
MinVerVerbosity --verbosity

Some edge-cases I could think of:

1. Environment variable is present, but I want to ignore it and use an empty value

e.g.

set MINVERBUILDMETADATA=ABC
set MINVERTAGPREFIX=DEF
minver --build-metadata "" --tag-prefix ""

✅ I confirmed it will use empty values instead of using the environment variables

2. MINVERVERSIONOVERRIDE correctly overrides the version (even when other environment variables) are present, but I want to opt-out of this, and let minver do its thing

⚠️ There's no way of opting out of this via the CLI... One would have to redefine the environment variable value in the build script before calling minver, but that seems OK to me.


:shipit: 🚀

Wow, thanks for the detailed testing @augustoproiete!

Regarding MINVERVERSIONOVERRIDE, I think the current behaviour makes sense, since that option is not intended to be used as a command line argument, but rather only as an environment variable.