Permalink
Browse files

Merge pull request #1416 from stuartherbert/non-interactive-rvm

Fix: do not use "less" when rvm is being run non-interactively
  • Loading branch information...
2 parents 85a830a + a1c8b86 commit 1e9716d0ae0d3b3e9f577a2adf3b3414477ee1c2 @richo richo committed Jan 1, 2013
Showing with 24 additions and 7 deletions.
  1. +24 −7 scripts/cli
View
@@ -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
+}

0 comments on commit 1e9716d

Please sign in to comment.