GithubHelp home page GithubHelp logo

madumlao / jenv-vars Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rbenv/rbenv-vars

0.0 3.0 0.0 94 KB

An rbenv plugin that safely sets global and per-project environment variables

License: MIT License

Shell 100.00%

jenv-vars's Introduction

jenv-vars

This is a plugin for jenv that lets you set global and project-specific environment variables before spawning Ruby processes.

jenv-vars is based on rbenv-vars by Sam Stephenson.

Installation

To install jenv-vars, clone this repository into your ~/.jenv/plugins directory. (You'll need a recent version of jenv that supports plugin bundles.)

$ mkdir -p ~/.jenv/plugins
$ cd ~/.jenv/plugins
$ git clone https://github.com/gcuisinier/jenv-vars.git

Usage

Define environment variables in an .jenv-vars file in your project, one variable per line, in the format VAR=value. For example:

CLASSPATH=src:lib/foo.jar

You can perform variable substitution with the traditional $ syntax. For example, to append to CLASSPATH:

CLASSPATH=src:lib/foo.jar:$CLASSPATH

You may also have conditional variable assignments, such that a variable will only be set if it is not already defined or is blank:

JAVA_OPTS?=-server -Xmx768m -Xms768m -Xmn128m -Xss20m

In the above case, JAVA_OPTS will only be set if $JAVA_OPTS is currently empty (i.e., if [ -z "$JAVA_OPTS" ] is true).

Spaces are allowed in values; quoting is not necessary. Expansion and command substitution are not allowed. Lines beginning with # or any lines not in the format VAR=value will be ignored.

Variables specified in the ~/.jenv/vars file will be set first. Then variables specified in .jenv-vars files in any parent directories of the current directory will be set. Variables from the .jenv-vars file in the current directory are set last.

Use the jenv vars command to print all environment variables in the order they'll be set.

Version History (jenv)

**1.2.0.1 (February 26, 2015)

  • Adapted rbenv-vars for jenv.

Version History (rbenv)

1.2.0 (January 9, 2013)

  • Fixed a bug where source files without a trailing newline could concatenate improperly with other source files on systems with GNU sed.
  • Changed the output of rbenv vars to include the source file path in a comment above its variables, and an empty line between each source file, for easier debugging.
  • Added support for rbenv help vars with jenv 0.4.0.

1.1.0 (June 25, 2012)

  • Added support for conditional variable assignments using ?=. Thanks to Scott Gonyea for the patch.

1.0.0 (September 27, 2011)

  • Initial public release.

License

© 2015 Mark David Dumlao. Released under the MIT license. See LICENSE for details.

jenv-vars's People

Contributors

sstephenson avatar mislav avatar thomasritz avatar madumlao avatar

Watchers

 avatar 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.