Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Implement rvm_ignore_rvmrc, to do installs without rvmrc files

  • Loading branch information...
commit 3c98ad955f0072a0218eb7991334f4d581a47467 1 parent 6fec84a
@Sutto Sutto authored
View
20 binscripts/rvm
@@ -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
View
8 binscripts/rvm-update-head
@@ -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
View
7 binscripts/rvm-update-latest
@@ -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
View
6 contrib/install-system-wide
@@ -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
20 scripts/rvm
@@ -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
1  scripts/utility
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.