1
0
Fork 0
mirror of synced 2024-05-24 19:15:22 -04:00
dotbot/test/tests/link-relative.bash
Anish Athalye daf8d82e02 Add functionality to create relative links
This commit adds an option to the extended configuration syntax for
linking files and directories. Enabling the relative option makes it so
that symbolic links are created with relative paths instead of absolute
paths.
2016-02-14 23:06:52 -05:00

37 lines
737 B
Bash

test_description='relative linking works'
. '../test-lib.bash'
test_expect_success 'setup' '
echo "apple" > ${DOTFILES}/f &&
mkdir ${DOTFILES}/d &&
echo "grape" > ${DOTFILES}/d/e
'
test_expect_success 'run' '
run_dotbot <<EOF
- link:
~/.f:
path: f
~/.frel:
path: f
relative: true
~/nested/.frel:
path: f
create: true
relative: true
~/.d:
path: d
relative: true
EOF
'
test_expect_success 'test' '
grep "apple" ~/.f &&
grep "apple" ~/.frel &&
[[ "$(readlink ~/.f)" == "$(readlink -f dotfiles/f)" ]] &&
[[ "$(readlink ~/.frel)" == "dotfiles/f" ]] &&
[[ "$(readlink ~/nested/.frel)" == "../dotfiles/f" ]] &&
grep "grape" ~/.d/e &&
[[ "$(readlink ~/.d)" == "dotfiles/d" ]]
'