From 4986ebe61e8a0f3aafacee2a027ea89feaed1bf7 Mon Sep 17 00:00:00 2001 From: sanmiguel Date: Thu, 3 Aug 2017 18:45:26 -0500 Subject: Always add shell_history to ERL_AFLAGS Even for erlangs before 20.0 - it should have no effect --- kerl | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/kerl b/kerl index 32b01db..986054b 100755 --- a/kerl +++ b/kerl @@ -768,6 +768,12 @@ REBAR_PLT_DIR="$absdir" export REBAR_PLT_DIR _KERL_ACTIVE_DIR="$absdir" export _KERL_ACTIVE_DIR +# https://twitter.com/mononcqc/status/877544929496629248 +export _KERL_SAVED_ERL_AFLAGS=" \$ERL_AFLAGS" +kernel_history=\$(echo "\$ERL_AFLAGS" | grep "kernel shell_history") +if [ -z "\$kernel_history" ]; then + export ERL_AFLAGS="-kernel shell_history enabled \$ERL_AFLAGS" +fi if [ -f "$KERL_CONFIG" ]; then . "$KERL_CONFIG"; fi if [ -n "\$KERL_ENABLE_PROMPT" ]; then _KERL_SAVED_PS1="\$PS1" @@ -900,19 +906,6 @@ 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 -kernel_history=\$(echo "\$ERL_AFLAGS" | grep "kernel shell_history") -if [ -z "\$kernel_history" ]; then - export ERL_AFLAGS="-kernel shell_history enabled \$ERL_AFLAGS" -fi -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 -- cgit v1.2.3