Permalink
Browse files

use a relative link for the `current` directory

  • Loading branch information...
1 parent ec92588 commit a109ab8ef9b3f8c0a78deea4fc27b500588c1aee @jneen committed Mar 16, 2012
Showing with 13 additions and 1 deletion.
  1. +13 −1 bin/ry
View
14 bin/ry
@@ -32,6 +32,18 @@ exists?() {
type "$@" &>/dev/null
}
+# indir <dir> <cmd...>
+# perform <cmd> in the directory <dir>
+#
+indir() {
+ local dir="$1"; shift
+ local olddir="$PWD"
+ cd "$dir" && "$@"
+ local status=$?
+ cd "$olddir"
+ return $status
+}
+
# setup
[[ -d $RY_LIB/rubies ]] || mkdir -p $RY_LIB/rubies
@@ -193,7 +205,7 @@ ry::use() {
assert_installed "$name"
rm -f "$RY_LIB/current"
- ln -s "$RY_LIB/rubies/$name" "$RY_LIB/current"
+ indir "$RY_LIB" ln -s "rubies/$name" current
ry current
}

0 comments on commit a109ab8

Please sign in to comment.