direnv icon indicating copy to clipboard operation
direnv copied to clipboard

install script permits args now and uses printf

Open inktrap opened this issue 1 year ago • 1 comments

I want to use the installer to run it with ansible's script module. There i can't set an environment variable and I don't like the idea to just take the first thing from $PATH. I like to download install scripts and to have a look what they are doing. And maybe then I add them to an ansible role.

Now one can specify the $bin_path as $1 or ask for --help or -h. Arguments overwrite environment variables. I checked this with shellcheck and everything was fine. And I checked the documented use case and my added use case.

inktrap avatar Jan 29 '25 11:01 inktrap

I realized that I can pass environment variables quite easily … however I also realized that the installer should probably try (in that order):

    $XDG_BIN_HOME
    $XDG_DATA_HOME/../bin
    $HOME/.local/bin

and that is not compatible to the previous behaviour of specifying $bin_path. So … I am going to leave this open, maybe it is still helpful and someone could provide some feedback if rewriting the installer to be more in line with conventions is helpful or not.

inktrap avatar Jan 29 '25 14:01 inktrap