diff options
author | Mark Allen <[email protected]> | 2017-06-22 13:57:34 -0500 |
---|---|---|
committer | Mark Allen <[email protected]> | 2017-06-22 13:57:34 -0500 |
commit | bd632628ece4542dfa2543937bb57bc7b6b82ece (patch) | |
tree | 37027fb9c7fc907d8cc929cccd00ce08081863ce /kerl | |
parent | 01af26f4a6106adc8cc8b088dc692065dadb84f0 (diff) | |
download | kerl-bd632628ece4542dfa2543937bb57bc7b6b82ece.tar.gz kerl-bd632628ece4542dfa2543937bb57bc7b6b82ece.tar.bz2 kerl-bd632628ece4542dfa2543937bb57bc7b6b82ece.zip |
Add automatic shell history flag for OTP >= 20
Diffstat (limited to 'kerl')
-rwxr-xr-x | kerl | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -717,6 +717,11 @@ do_install() # credits to virtualenv kerl_deactivate() { + if [ -n "\$_KERL_SAVED_ERL_AFLAGS" ]; then + ERL_AFLAGS="\$_KERL_SAVED_ERL_AFLAGS" + export ERL_AFLAGS + unset _KERL_SAVED_ERL_AFLAGS + fi if [ -n "\$_KERL_PATH_REMOVABLE" ]; then PATH=\`echo \${PATH} | sed -e "s#\${_KERL_PATH_REMOVABLE}:##"\` export PATH @@ -894,6 +899,17 @@ endif rehash ACTIVATE_CSH + + otpver=$(get_otp_version "$rel") + if [ $otpver -ge 20 ]; then + # https://twitter.com/mononcqc/status/877544929496629248 + cat << OTP_20_ADDITION >> "$absdir/activate" +_KERL_SAVED_ERL_AFLAGS="\$ERL_AFLAGS" +export _KERL_SAVED_ERL_AFLAGS +export ERL_AFLAGS="-kernel shell_history_enabled \$ERL_AFLAGS" +OTP_20_ADDITION + fi + if [ -n "$KERL_BUILD_DOCS" ]; then DOC_DIR="$KERL_BUILD_DIR/$1/release_$rel/lib/erlang" if [ -d "$DOC_DIR" ]; then |