Skip to content
Browse files

avoid using cd function internally, update #1148, update #1150

  • Loading branch information...
1 parent eb8de33 commit f2a4cce0d46333f1ba518ad96434a4a72979fe65 @mpapis mpapis committed
Showing with 13 additions and 13 deletions.
  1. +2 −2 scripts/alias
  2. +1 −1 scripts/disk-usage
  3. +2 −2 scripts/functions/installer
  4. +6 −6 scripts/functions/manage/base
  5. +1 −1 scripts/functions/reset
  6. +1 −1 scripts/migrate
View
4 scripts/alias
@@ -184,7 +184,7 @@ alias_list() {
done
;;
esac < <(
- cd "$rvm_rubies_path"
+ builtin cd "$rvm_rubies_path"
find . -maxdepth 1 -mindepth 1 -type l | sed -e 's#.*/##'
)
}
@@ -193,7 +193,7 @@ alias_search_by_target() {
typeset item items target search
search="${alias_name}@${gemset_name}"
- items=($(cd "$rvm_rubies_path" ; find . -maxdepth 1 -mindepth 1 -type l | sed -e 's#./##'))
+ items=($(builtin cd "$rvm_rubies_path" ; find . -maxdepth 1 -mindepth 1 -type l | sed -e 's#./##'))
for item in "${items[@]}"
do
View
2 scripts/disk-usage
@@ -72,7 +72,7 @@ case "${1:-help}" in
all|total|archives|repos|sources|logs|pkg|rubies|gemsets|wrappers|tmp|others)
(
export length=""
- cd $rvm_path
+ builtin cd $rvm_path
$1_disk_usage
)
;;
View
4 scripts/functions/installer
@@ -308,7 +308,7 @@ install_rvm_hooks()
setup_configuration_files()
{
- pushd "$rvm_path" >/dev/null
+ builtin pushd "$rvm_path" >/dev/null
if [[ -f config/user ]]
then
@@ -340,7 +340,7 @@ setup_configuration_files()
GREP_OPTIONS="" \grep '^_' user/rvmrcs > user/rvmrcs.new || true
mv user/rvmrcs.new user/rvmrcs
- popd >/dev/null
+ builtin popd >/dev/null
}
ensure_scripts_are_executable()
View
12 scripts/functions/manage/base
@@ -369,7 +369,7 @@ __rvm_fetch_from_git_revision_or_sha()
[[ -n "$rvm_ruby_revision" ]]
then
(
- cd "${rvm_repos_path}/${rvm_ruby_interpreter}"
+ builtin cd "${rvm_repos_path}/${rvm_ruby_interpreter}"
[[ "$rvm_ruby_revision" != "head" ]] || rvm_ruby_revision="master"
git checkout -f "${rvm_ruby_revision}"
)
@@ -377,7 +377,7 @@ __rvm_fetch_from_git_revision_or_sha()
[[ -n "${rvm_ruby_sha:-}" ]]
then
(
- cd "${rvm_repos_path}/${rvm_ruby_interpreter}"
+ builtin cd "${rvm_repos_path}/${rvm_ruby_interpreter}"
git checkout -f "${rvm_ruby_sha}"
)
fi
@@ -405,7 +405,7 @@ __rvm_fetch_from_github()
then
typeset existing_uri
existing_uri="$(
- cd "${rvm_repos_path}/${rvm_ruby_interpreter}" >/dev/null
+ builtin cd "${rvm_repos_path}/${rvm_ruby_interpreter}" >/dev/null
git remote -v 2>/dev/null | awk '/^origin.*fetch/ {print $2}'
)"
if
@@ -444,7 +444,7 @@ __rvm_fetch_from_github()
(
remote="origin"
- cd "${rvm_repos_path}/${rvm_ruby_interpreter}"
+ builtin cd "${rvm_repos_path}/${rvm_ruby_interpreter}"
if
[[ -z "$(git branch | awk "/$rvm_ruby_repo_branch$/")" ]]
@@ -613,7 +613,7 @@ __rvm_fetch_ruby()
return $?
else
(
- cd "${rvm_repos_path}/${rvm_ruby_interpreter}"
+ builtin cd "${rvm_repos_path}/${rvm_ruby_interpreter}"
typeset current_url
current_url="$(git remote -v | awk '$1=="origin" && $3=="(fetch)" {print $2}')"
[[ "$current_url" == "$rvm_ruby_repo_url" ]] || git remote set-url origin "$rvm_ruby_repo_url"
@@ -622,7 +622,7 @@ __rvm_fetch_ruby()
# Use the selected branch.
(
- cd "${rvm_repos_path}/${rvm_ruby_interpreter}"
+ builtin cd "${rvm_repos_path}/${rvm_ruby_interpreter}"
remote="${remote:-origin}"
branch=$(git symbolic-ref -q HEAD 2>/dev/null)
View
2 scripts/functions/reset
@@ -51,7 +51,7 @@ __rvm_reset()
done
- files=(ruby gem rake irb $(cd "${rvm_bin_path}" ; \
+ files=(ruby gem rake irb $(builtin cd "${rvm_bin_path}" ; \
find . -mindepth 1 -maxdepth 1 -iname 'default*' -type f \
| \sed -e 's#./##g'))
View
2 scripts/migrate
@@ -129,7 +129,7 @@ migrate_rubies()
if confirm "Do you wish to move over wrappers?"
then
origin_wrappers_path="$rvm_wrappers_path/$expanded_source"
- binaries=($(cd "${rvm_bin_path}" ; find . -maxdepth 1 -mindepth 1 -type f))
+ binaries=($(builtin cd "${rvm_bin_path}" ; find . -maxdepth 1 -mindepth 1 -type f))
for binary_name in "${binaries[@]//.\/}"
do

0 comments on commit f2a4cce

Please sign in to comment.
Something went wrong with that request. Please try again.