Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix: do not use "less" when rvm is being run non-interactively

  • Loading branch information...
commit a1c8b86bdd97bed6c6f9e29e105c7f489924171c 1 parent 85a830a
@stuartherbert stuartherbert authored
Showing with 24 additions and 7 deletions.
  1. +24 −7 scripts/cli
View
31 scripts/cli
@@ -1068,13 +1068,21 @@ To reinstall use:
rvm_is_a_shell_function no_warning
then
{
- echo "Ruby (and needed base gems) for your selection will be installed shortly."
- echo "Before it happens, please read and execute the instructions below."
- echo "Please use a separate terminal to execute any additional commands."
- echo "(use keyboard arrows to navigate)"
- "$rvm_scripts_path"/requirements
- echo "Press 'q' to continue."
- } | less
+ if [[ -t 1 ]]
+ then
+ echo "Ruby (and needed base gems) for your selection will be installed shortly."
+ echo "Before it happens, please read and execute the instructions below."
+ echo "Please use a separate terminal to execute any additional commands."
+ echo "(use keyboard arrows to navigate)"
+ "$rvm_scripts_path"/requirements
+ echo "Press 'q' to continue."
+ else
+ echo "Ruby (and needed base gems) for your selection will now be installed."
+ echo "If you encounter any problems, please read and execute the instructions"
+ echo "below before trying again."
+ "$rvm_scripts_path"/requirements
+ fi
+ } | rvm_less
fi
__rvm_manage_wrapper install "${rvm_ruby_strings}"
fi
@@ -1166,3 +1174,12 @@ To reinstall use:
return ${result:-0}
}
+
+# deal with things when we're not running interactively
+rvm_less() {
+ if [[ -t 1 ]] ; then
+ less
+ else
+ cat
+ fi
+}
Please sign in to comment.
Something went wrong with that request. Please try again.