Putting the installation method of scala-cli in an environment variable or a metadata file #670
Labels
priority: low
requires scoping
Issue requires a spike to revalidate it and assign an up-to date scope for its requirements.
UX
Related to issue #543 currently, if a user forgets the previous method they used for installing scala-cli on their system, they might use another one for reinstalling. This creates a duplicate in PATH; therefore, even when a newer version is installed later, through a second method, this would be the old version that might show up first on PATH and get executed.
How it should behave:
The user types
scala-cli —version
orscala-cli about
orscala-cli update
.Then the user receives information about the method with which they have installed scala-cli, for example Homebrew; and instructions get shown to them about how they should update scala-cli using this installation method, such as Homebrew.
How it can get Implemented :
We create a hidden command for
scala-cli
such asinstallMethod
which then gets run by the installation tool, post installation. Upon receiving a command likescala-cli installMethod brew
, Scala CLI creates an environment variable called$SCALA_CLI_INSTALLATION_METHOD
and assigns the valuebrew
to it.This way, each time the
about
,version
, orupdate
commands are called; scala-cli can just read the value of this environment variable for knowing how it is installed, or even update itself through the same method.Alternatively, the installation method can be written by the installation method to a metadata file put in the same directory as the executable file of scala-cli. Then scala-cli can read the contents of this file for responding to the above mentioned commands. The downside of this method is that the metadata file would get lost upon an installation directory change.
The text was updated successfully, but these errors were encountered: