aboutsummaryrefslogtreecommitdiffstats
path: root/kerl
diff options
context:
space:
mode:
authorYurii Rashkovskii <[email protected]>2013-12-12 03:31:31 -0800
committerYurii Rashkovskii <[email protected]>2013-12-12 03:31:31 -0800
commit69841dea4fadc95c4df51469104b8dbe9e51c862 (patch)
tree6185530e7abd95aae99bc1166397bbab059655ad /kerl
parent2f2c05d3907a351c9ae180c8477f1ed9e89f1d83 (diff)
parent83ff2e9e3f7c2b660f53d1f0543ca451531c3be5 (diff)
downloadkerl-69841dea4fadc95c4df51469104b8dbe9e51c862.tar.gz
kerl-69841dea4fadc95c4df51469104b8dbe9e51c862.tar.bz2
kerl-69841dea4fadc95c4df51469104b8dbe9e51c862.zip
Merge pull request #58 from sanmiguel/improve-deactivate
Change of env var restoration mechanism in activate script
Diffstat (limited to 'kerl')
-rwxr-xr-xkerl27
1 files changed, 13 insertions, 14 deletions
diff --git a/kerl b/kerl
index 2560571..dd3072d 100755
--- a/kerl
+++ b/kerl
@@ -432,15 +432,15 @@ do_install()
# credits to virtualenv
kerl_deactivate()
{
- if [ -n "\$_KERL_SAVED_PATH" ]; then
- PATH="\$_KERL_SAVED_PATH"
+ if [ -n "\$_KERL_PATH_REMOVABLE" ]; then
+ PATH=\${PATH//\${_KERL_PATH_REMOVABLE}:/}
export PATH
- unset _KERL_SAVED_PATH
+ unset _KERL_PATH_REMOVABLE
fi
- if [ -n "\$_KERL_SAVED_MANPATH" ]; then
- MANPATH="\$_KERL_SAVED_MANPATH"
+ if [ -n "\$_KERL_MANPATH_REMOVABLE" ]; then
+ MANPATH=\${MANPATH//\${_KERL_MANPATH_REMOVABLE}:/}
export MANPATH
- unset _KERL_SAVED_MANPATH
+ unset _KERL_MANPATH_REMOVABLE
fi
if [ -n "\$_KERL_SAVED_REBAR_PLT_DIR" ]; then
REBAR_PLT_DIR="\$_KERL_SAVED_REBAR_PLT_DIR"
@@ -460,16 +460,15 @@ kerl_deactivate()
fi
}
kerl_deactivate nondestructive
-_KERL_SAVED_PATH="\$PATH"
-export _KERL_SAVED_PATH
-_KERL_SAVED_MANPATH="\$MANPATH"
-export _KERL_SAVED_MANPATH
+
_KERL_SAVED_REBAR_PLT_DIR="\$REBAR_PLT_DIR"
export _KERL_SAVED_REBAR_PLT_DIR
-PATH="$absdir/bin:\$PATH"
-export PATH
-MANPATH="$absdir/man:\$MANPATH"
-export MANPATH
+_KERL_PATH_REMOVABLE="$absdir/bin"
+PATH="\${_KERL_PATH_REMOVABLE}:\$PATH"
+export PATH _KERL_PATH_REMOVABLE
+_KERL_MANPATH_REMOVABLE="$absdir/man"
+MANPATH="\${_KERL_MANPATH_REMOVABLE}:\$MANPATH"
+export MANPATH _KERL_MANPATH_REMOVABLE
REBAR_PLT_DIR="$absdir"
export REBAR_PLT_DIR
if [ -f "$KERL_CONFIG" ]; then . "$KERL_CONFIG"; fi