summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAnish Athalye <me@anishathalye.com>2016-08-17 18:15:02 -0700
committerAnish Athalye <me@anishathalye.com>2016-08-17 18:27:47 -0700
commit28959a3f31d8632975de4e18d0a0e47476b5a413 (patch)
treed80168df64b54671e3785e815762316fbe1d38b1 /test
parentf04b94d4ae98599568d868c6d14d2ea428d4f16a (diff)
Fix user expansion in link source
Previous to this patch, having a config like the following would not work properly: - link: ~/a: ~/b This was because the '~' was expanded on the left hand side (the link target), but not the right hand side (the link source). It was necessary to use a workaround like this: - link: ~/a: $HOME/b This was because variable expansion was being done, but user expansion was not being done. This commit adds support for using '~' in the link source.
Diffstat (limited to 'test')
-rw-r--r--test/tests/link-environment-user-expansion-target.bash17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/tests/link-environment-user-expansion-target.bash b/test/tests/link-environment-user-expansion-target.bash
new file mode 100644
index 0000000..9cb3424
--- /dev/null
+++ b/test/tests/link-environment-user-expansion-target.bash
@@ -0,0 +1,17 @@
+test_description='link expands user in target'
+. '../test-lib.bash'
+
+test_expect_success 'setup' '
+echo "apple" > ~/f
+'
+
+test_expect_success 'run' '
+run_dotbot <<EOF
+- link:
+ ~/g: ~/f
+EOF
+'
+
+test_expect_success 'test' '
+grep "apple" ~/g
+'