aboutsummaryrefslogtreecommitdiff
path: root/rpath.sh
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2014-06-15 19:10:22 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2014-06-15 19:10:22 -0700
commit67b93d09ef2f60acd62d83bf3a9796e390b93bd7 (patch)
treeedaafde1207895cd537c4dc845b4b8282c6188ad /rpath.sh
parent0ddc8a54ee0bd8357d0546ed5e0057115ce8afec (diff)
downloadrbpm-67b93d09ef2f60acd62d83bf3a9796e390b93bd7.tar.gz
rbpm-67b93d09ef2f60acd62d83bf3a9796e390b93bd7.tar.xz
More aggressive variable scoping.
Diffstat (limited to 'rpath.sh')
-rwxr-xr-xrpath.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/rpath.sh b/rpath.sh
index 3f05790..f79abdc 100755
--- a/rpath.sh
+++ b/rpath.sh
@@ -52,7 +52,6 @@ _populate_dirs() {
_populate_selected() {
local dir dirs
- unset selected
IFS=':' read -a dirs <<< "${PATH}"
@@ -93,6 +92,8 @@ _add() {
}
rpath_ls() {
+ local dir dirs selected str
+
_populate_dirs
_populate_selected
@@ -106,6 +107,8 @@ rpath_ls() {
}
rpath_get() {
+ local dir selected
+
_populate_selected || _die 'no rubies found in PATH.'
for dir in "${selected[@]}"; do
@@ -116,6 +119,8 @@ rpath_get() {
rpath_set() {
[[ -n "${1}" ]] || _die 'set command requires an argument.'
+ local dir dirs match
+
_populate_dirs
for dir in "${dirs[@]}"; do