ab7cbd42dc
For example, will handle an entire directory tree of files, linking all files: ``` - link: ~/.config/: path: dotconf/config/** glob: true ``` NOTE, this feature requires newer versions of `glob()` (Python >= 3.5), and `dotbot` will throw an error if using an earlier version of python. For testing purposes, added: - ability to skip tests in test harness - added testing for older Python(s). FIXES: #270
46 lines
964 B
Bash
46 lines
964 B
Bash
test_description='link glob recursive'
|
|
. '../test-lib.bash'
|
|
|
|
check_python_version ">=" 3.5 \
|
|
|| test_expect_failure 'expect-fail' '
|
|
run_dotbot -v <<EOF
|
|
- link:
|
|
~/.config/:
|
|
glob: true
|
|
path: bogus/**
|
|
EOF
|
|
'
|
|
|
|
# Skip remaining tests if not supported
|
|
check_python_version ">=" 3.5 \
|
|
|| skip_tests
|
|
|
|
test_expect_success 'setup' '
|
|
mkdir -p ${DOTFILES}/config/foo/bar &&
|
|
echo "apple" > ${DOTFILES}/config/foo/bar/a &&
|
|
echo "banana" > ${DOTFILES}/config/foo/bar/b &&
|
|
echo "cherry" > ${DOTFILES}/config/foo/bar/c
|
|
'
|
|
|
|
test_expect_success 'run' '
|
|
run_dotbot -v <<EOF
|
|
- defaults:
|
|
link:
|
|
glob: true
|
|
create: true
|
|
- link:
|
|
~/.config/:
|
|
path: config/**
|
|
exclude: [config/**/b]
|
|
EOF
|
|
'
|
|
|
|
test_expect_success 'test' '
|
|
! readlink ~/.config/ &&
|
|
! readlink ~/.config/foo &&
|
|
! readlink ~/.config/foo/bar &&
|
|
readlink ~/.config/foo/bar/a &&
|
|
grep "apple" ~/.config/foo/bar/a &&
|
|
test \! -e ~/.config/foo/bar/b &&
|
|
grep "cherry" ~/.config/foo/bar/c
|
|
'
|