diff options
author | Radu Ciorba <[email protected]> | 2017-08-12 01:25:16 +0300 |
---|---|---|
committer | Radu Ciorba <[email protected]> | 2017-08-12 01:32:48 +0300 |
commit | 1a1b11f4304dc7b9e3e9e86ac8680d9997fc01ff (patch) | |
tree | 993bb4489a6ddb988a7a563c94f5fa5e8d64bf22 | |
parent | ad7e0184535ebbedb21cbcac82ce5ca769ce0ae5 (diff) | |
download | kerl-1a1b11f4304dc7b9e3e9e86ac8680d9997fc01ff.tar.gz kerl-1a1b11f4304dc7b9e3e9e86ac8680d9997fc01ff.tar.bz2 kerl-1a1b11f4304dc7b9e3e9e86ac8680d9997fc01ff.zip |
suggest the correct activate script based on parent process command
Looks at parent process command and suggests sourcing the appropriate
activate script for fish and csh.
fixes #224
-rwxr-xr-x | kerl | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -932,8 +932,23 @@ ACTIVATE_CSH build_plt "$absdir" fi + PID=$$ + PPID=$(ps -p $PID -o ppid | grep -E "[0-9]+" -o) + PARENT_CMD=$(ps -p $PPID -o comm | tail -n 1) + case "$PARENT_CMD" in + fish) + SHELL_SUFFIX=".fish" + ;; + csh) + SHELL_SUFFIX=".csh" + ;; + *) + SHELL_SUFFIX="" + ;; + esac + echo "You can activate this installation running the following command:" - echo ". $absdir/activate" + echo ". ${absdir}/activate${SHELL_SUFFIX}" echo "Later on, you can leave the installation typing:" echo "kerl_deactivate" } |