GithubHelp home page GithubHelp logo

direnv-modules's Introduction

direnv Modules

direnv is an extension for your shell. It augments existing shells with a new feature that can load and unload environment variables depending on the current directory.”

“The Environment Modules package is a tool that simplify shell initialization and lets users easily modify their environment during the session with modulefiles. Modules can be loaded and unloaded dynamically and atomically, in an clean fashion.”

This is an Environment Modules-like interface built on top of direnv, for those who want the best of both worlds.

Here’s a quick demo

https://asciinema.org/a/405131.svg

Setup

Create dmodulefiles in a directory structure like this:

mkdir /opt/dmodulefiles
mkdir /opt/dmodulefiles/tool_a
mkdir /opt/dmodulefiles/tool_b

Inside the tool_a and tool_b directories, create text files named for the version of the tool the dmodulefile is for. In that text file write shell syntax code to set environment variable that are needed by the tool. For example, in /opt/dmodulefiles/tools_a/1.3 you might have:

export PATH=/path/to/tool_a/bin:$PATH
export LM_LICENSE_FILE=4567@license_server

Then, in your ~/.profile add this line:

export DMODULEPATH=/top/dmodulefiles

Then copy dm and dm-editor to some directory in your PATH.

Usage

Everything is handled by the dm (for direnv module) command. These are its sub commands:

avail

List all available modulefiles in the current DMODULEPATH

help

Print the usage of each sub-command. If an argument is given, print the Module-specific help information for the dmodulefile.

list

List loaded modules.

load modulefile…

Load modulefile into the shell environment.

purge

Unload all loaded modulefiles.

reload

Unload then load all loaded modulefiles.

unload modulefile…

Remove modulefile from the shell environment.

direnv-modules's People

Contributors

krupan avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.