Mirceac21
Mirceac21

Reputation: 1754

Is it possible to have commands available in specific directories only?

Is it possible to have a directory isolated bin folder? All packages installed to be available only in that specific directory?

For example I have a directory ~/projects and I would like to have git command available only in that folder.

Upvotes: 0

Views: 148

Answers (1)

ErikMD
ErikMD

Reputation: 14753

I think you may be interested in using one of these two tools:

  1. https://github.com/kennethreitz/autoenv
  2. https://github.com/direnv/direnv

The first tool (autoenv, mostly written in Bash) is simpler to install and use but is not maintained anymore, and the second tool (direnv, mostly written in Go) provides more features, including the ability to unset environment variables.

For more details on their respective features, you can take a look at this GitHub issue.

Upvotes: 2

Related Questions