Permalink
Browse files

Implement rvm_ignore_rvmrc, to do installs without rvmrc files

  • Loading branch information...
1 parent 6fec84a commit 3c98ad955f0072a0218eb7991334f4d581a47467 @Sutto Sutto committed Aug 6, 2010
Showing with 38 additions and 24 deletions.
  1. +11 −9 binscripts/rvm
  2. +6 −2 binscripts/rvm-update-head
  3. +5 −2 binscripts/rvm-update-latest
  4. +4 −2 contrib/install-system-wide
  5. +11 −9 scripts/rvm
  6. +1 −0 scripts/utility
View
@@ -1,15 +1,17 @@
#!/usr/bin/env bash
-for rvmrc in /etc/rvmrc "$HOME/.rvmrc" ; do
- if [[ -f "$rvmrc" ]] ; then
- if grep -q '^\s*rvm .*$' "$rvmrc" ; then
- printf "\nError: $rvmrc is for rvm settings only.\nrvm CLI may NOT be called from within $rvmrc. \nSkipping the loading of $rvmrc"
- exit 1
- else
- source "$rvmrc"
+if [[ -z "$rvm_ignore_rvmrc" ]]; then
+ for rvmrc in /etc/rvmrc "$HOME/.rvmrc" ; do
+ if [[ -f "$rvmrc" ]] ; then
+ if grep -q '^\s*rvm .*$' "$rvmrc" ; then
+ printf "\nError: $rvmrc is for rvm settings only.\nrvm CLI may NOT be called from within $rvmrc. \nSkipping the loading of $rvmrc"
+ exit 1
+ else
+ source "$rvmrc"
+ fi
fi
- fi
-done
+ done
+fi
[[ -z "$rvm_prefix" ]] && unset rvm_prefix
[[ -z "$rvm_path" ]] && unset rvm_path
@@ -1,6 +1,10 @@
#!/usr/bin/env bash
-if [[ -f /etc/rvmrc ]] ; then source /etc/rvmrc ; fi
-if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
+
+if [[ -z "$rvm_ignore_rvmrc" ]]; then
+ [[ -s /etc/rvmrc ]] && source /etc/rvmrc
+ [[ -s "$HOME/.rvmrc" ]] && source "$HOME/.rvmrc"
+fi
+
rvm_path="${rvm_path:-$HOME/.rvm}"
mkdir -p $rvm_path/src/
cd $rvm_path/src
@@ -1,7 +1,10 @@
#!/usr/bin/env bash
-if [[ -f /etc/rvmrc ]] ; then source /etc/rvmrc ; fi
-if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
+if [[ -z "$rvm_ignore_rvmrc" ]]; then
+ [[ -s /etc/rvmrc ]] && source /etc/rvmrc
+ [[ -s "$HOME/.rvmrc" ]] && source "$HOME/.rvmrc"
+fi
+
rvm_path="${rvm_path:-$HOME/.rvm}"
mkdir -p $rvm_path/src/
cd $rvm_path/src
@@ -13,8 +13,10 @@ if ! command -v git >/dev/null 2>&1 ; then
fi
# Load the rvm config.
-[[ -s /etc/rvmrc ]] && source /etc/rvmrc
-[[ -s "$HOME/.rvmrc" ]] && source "$HOME/.rvmrc"
+if [[ -z "$rvm_ignore_rvmrc" ]]; then
+ [[ -s /etc/rvmrc ]] && source /etc/rvmrc
+ [[ -s "$HOME/.rvmrc" ]] && source "$HOME/.rvmrc"
+fi
rvm_path="${rvm_path:-"/usr/local/rvm"}"
export rvm_sandboxed=0
View
@@ -9,16 +9,18 @@ rvm_loaded_flag="${rvm_loaded_flag:-0}"
if [[ "$rvm_loaded_flag" != "1" ]] || [[ "$rvm_reload_flag" = "1" ]] ; then
unset rvm_reload_flag
- for rvmrc in /etc/rvmrc $HOME/.rvmrc ; do
- if [[ -f "$rvmrc" ]] ; then
- if grep -q '^\s*rvm .*$' $rvmrc ; then
- printf "\nError: $rvmrc is for rvm settings only.\nrvm CLI may NOT be called from within $rvmrc. \nSkipping the loading of $rvmrc"
- return 1
- else
- source "$rvmrc"
+ if [[ -z "$rvm_ignore_rvmrc" ]]; then
+ for rvmrc in /etc/rvmrc $HOME/.rvmrc ; do
+ if [[ -f "$rvmrc" ]] ; then
+ if grep -q '^\s*rvm .*$' $rvmrc ; then
+ printf "\nError: $rvmrc is for rvm settings only.\nrvm CLI may NOT be called from within $rvmrc. \nSkipping the loading of $rvmrc"
+ return 1
+ else
+ source "$rvmrc"
+ fi
fi
- fi
- done
+ done
+ fi
# Set the default sandboxed value.
if [[ -z "$rvm_sandboxed" ]]; then
View
@@ -302,6 +302,7 @@ __rvm_set_rvmrc() {
}
__rvm_load_rvmrc() {
+ [[ -z "$rvm_ignore_rvmrc" ]] && return
for rvmrc in /etc/rvmrc $HOME/.rvmrc ; do
if [[ -f "$rvmrc" ]] ; then
if grep -q '^\s*rvm .*$' $rvmrc ; then

0 comments on commit 3c98ad9

Please sign in to comment.