condax icon indicating copy to clipboard operation
condax copied to clipboard

Scriptable (commandline) customization of CONDAX_LINK_DESTINATION (link_destination)

Open mforbes opened this issue 2 years ago • 4 comments

The link_destination can be customized in the .condarc, but this is inconvenient for scripts.

It would be helpful if this could be set on the command line, either with a specific flag, or through an environmental variable.

For reference, pipx uses PIPX_BIN_DIR.

My use-case is to use condax to provision my system, so need to link the executables to /usr/local/bin/ rather than a home directory.

A quick hack would be something like this in config.py:

CONDAX_LINK_DESTINATION = path.expanduser(
    os.environ.get(
        'CONDAX_LINK_DESTINATION',
        _config["link_destination"]))

mforbes avatar Jul 11 '22 19:07 mforbes

Typically, link_destination entry in ~/.condaxrc sets the link destination. https://mariusvniekerk.github.io/condax/config/

But in your case, you need to run with sudo hence /root/.condaxrc is the location.

link_destination: /usr/local/bin/

yamaton avatar Jul 12 '22 17:07 yamaton

@yamaton Thanks. That works, but it is not very convenient for scripts. I have changed this to a feature request for a command-line option (or environmental variable) way of modifying this for install scripts.

mforbes avatar Jul 12 '22 18:07 mforbes

Moving the configuration system to allow it to make use of something like pydantic's BaseSettings will probably help a bunch

mariusvniekerk avatar Aug 22 '22 13:08 mariusvniekerk

Is there a plan to do this? It would really help to have this customizability.

mforbes avatar Jul 13 '23 01:07 mforbes