Merge: introduce nit_env.sh to setup the shell environement
authorJean Privat <jean@pryen.org>
Wed, 28 Oct 2015 17:02:28 +0000 (13:02 -0400)
committerJean Privat <jean@pryen.org>
Wed, 28 Oct 2015 17:02:28 +0000 (13:02 -0400)
The script `nit_env.sh` tries to auto-magically configure PATH, MANPATH and bash completion for users. The point is to be as portable and simple a possible for the final used has he just has to write

~~~
$ source misc/nit_env.sh
~~~

and get a working setup.

Moreover, if `install` in given as argument, then the script register itself to the user `$HOME/.profile`.

~~~
$ source misc/nit_env.sh install
~~~

One advantage is that the script invocation is registered in `.profile`, thus future evolutions of the script will be automatically used in future sessions of the users.

Pull-Request: #1784
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

1  2 
README.md

diff --cc README.md
+++ b/README.md
@@@ -52,11 -56,11 +52,9 @@@ How to start
      $ bin/nitc examples/hello_world.nit
      $ ./hello_world
  
- You can put the `bin/` directory in your PATH
+ You can source `misc/nit_env.sh` to setup your environment like PATH, MANPATH and bash completion.
+ To have your environment automatically configured at login, just source it with `install` as argument.
  
- Using bash completion with Nit tools:
-     $ echo source /absolute/path/to/misc/bash_completion/nit >> ~/.bash_completion
-     $ source ~/.bash_completion
+     $ . misc/nit_env.sh install
  
 -More information:
 -
 -      http://www.nitlanguage.org
 +More information: <http://www.nitlanguage.org>