gobrew icon indicating copy to clipboard operation
gobrew copied to clipboard

init should add paths at the end of $PATH

Open goloroden opened this issue 8 years ago • 1 comments

When running gobrew init, the CLI adds a few paths to the PATH environment variable. Unfortunately it adds them in the beginning, not at the end.

This is bad in terms of performance because every call to a binary will then first search these paths, before looking at regular paths such as /usr/local/bin (and I guess that system binaries are more often called than the ones in the directories added by gobrew).

Furthermore this leads to the situation where binaries in the directories added by gobrew have higher precedence than anything that was installed before.

Could this be changed to adding the directories in the end instead of at the beginning?

goloroden avatar Nov 15 '16 11:11 goloroden

If I add eval "$(gobrew init -)" to my zsh config I get the following after source .zshrc

[Info] Invalid usage

gobrew 1.4.0

Usage:
    gobrew help                         Show this message
    gobrew use <version>                Use <version>
    gobrew install <version>            Download and install <version> (from binary))
    gobrew uninstall <version>          Uninstall <version>
    gobrew list                         List installed versions
    gobrew ls                           Alias for list
    gobrew ls-remote                   	List remote versions (including rc|beta versions)
    gobrew self-update                 	Self update this tool

Example:
    # install and use
    gobrew use 1.16

I took it out and the tool seems to work file without it.

What does eval "$(gobrew init -)" actually do?

redeemefy avatar Dec 27 '21 17:12 redeemefy