summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am1
-rwxr-xr-xbin/lsrc.in2
-rw-r--r--test/rcrc-tilde.t10
3 files changed, 13 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 613b926..16164d9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -31,6 +31,7 @@ TESTS = \
test/mkrc-usage.t \
test/mkrc-undotted.t \
test/rcrc-custom.t \
+ test/rcrc-tilde.t \
test/rcrc-hostname.t \
test/rcrc.t \
test/rcup-link-files.t \
diff --git a/bin/lsrc.in b/bin/lsrc.in
index b0dc30a..5a0774a 100755
--- a/bin/lsrc.in
+++ b/bin/lsrc.in
@@ -320,6 +320,8 @@ relative_root_dir="$PWD"
for DOTFILES_DIR in $DOTFILES_DIRS; do
cd "$relative_root_dir"
+ DOTFILES_DIR="$(eval echo "$DOTFILES_DIR")"
+
if is_relative $DOTFILES_DIR; then
DOTFILES_DIR="$PWD/$DOTFILES_DIR"
fi
diff --git a/test/rcrc-tilde.t b/test/rcrc-tilde.t
new file mode 100644
index 0000000..b3f98c1
--- /dev/null
+++ b/test/rcrc-tilde.t
@@ -0,0 +1,10 @@
+ $ . "$TESTDIR/helper.sh"
+
+rcrc should accept a DOTFILES_DIR with a ~ instead of $HOME
+
+ $ mkdir ~/.other-dotfiles
+ > touch ~/.other-dotfiles/o-example
+
+ $ echo 'DOTFILES_DIRS="~/.other-dotfiles"' > alt-rcrc
+ $ RCRC=./alt-rcrc lsrc
+ /*/.o-example:/*/.other-dotfiles/o-example (glob)