Ampersand icon indicating copy to clipboard operation
Ampersand copied to clipboard

Check for required Ampersand version

Open Michiel-s opened this issue 5 years ago • 1 comments

Like with dependency management system, I would like to specify the version (range) of the Ampersand compiler that works with my script. This allows to transfer projects and work together on code more easily.

Just to keep things simple, I suggest to add a switch, which then can also be set in the config yaml. As our versioning systems follows semantic versioning, we can parse the specified required version and let the compiler check if it matches that version (range).

The switch can be called something like ampersandVersion

To specify the required version (range) we can look how others have done this, e.g.:

First things first. Let’s implement a basic scenario first:

Exact version

ampersandVersion: 3.17.2

A specific minor release

ampersandVersion: 3.17.x (any 3.17 patch version) ampersandVersion: ^3.17.2 (>= 3.17.2, <3.18)

A specific major release

ampersandVersion: 3.x (any 3 minor version) ampersandVersion: ^3.17 (>= 3.17, < 4)

The important construct here, which I think we will appreciate is the carrot (^).

Michiel-s avatar Jul 24 '19 20:07 Michiel-s