link.py: globbing keep leading '.'
- Updated plugins/link.py so that globbing will not strip leading '.' when creating link names. - Corrected test collection output in test/link-glob-multi-start Fixes #244
This commit is contained in:
parent
5294594f5a
commit
d6694f9653
3 changed files with 27 additions and 1 deletions
|
@ -76,6 +76,8 @@ class Link(dotbot.Plugin):
|
||||||
else:
|
else:
|
||||||
self._log.lowinfo("Globs from '" + path + "': " + str(glob_results))
|
self._log.lowinfo("Globs from '" + path + "': " + str(glob_results))
|
||||||
glob_base = path[:glob_star_loc]
|
glob_base = path[:glob_star_loc]
|
||||||
|
if glob_base.endswith('/.'):
|
||||||
|
glob_base = path[:glob_star_loc - 1]
|
||||||
for glob_full_item in glob_results:
|
for glob_full_item in glob_results:
|
||||||
glob_item = glob_full_item[len(glob_base):]
|
glob_item = glob_full_item[len(glob_base):]
|
||||||
glob_link_destination = os.path.join(destination, glob_item)
|
glob_link_destination = os.path.join(destination, glob_item)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
test_description='link glob'
|
test_description='link glob multi star'
|
||||||
. '../test-lib.bash'
|
. '../test-lib.bash'
|
||||||
|
|
||||||
test_expect_success 'setup' '
|
test_expect_success 'setup' '
|
||||||
|
|
|
@ -45,3 +45,27 @@ grep "apple" ~/bin/a &&
|
||||||
grep "banana" ~/bin/b &&
|
grep "banana" ~/bin/b &&
|
||||||
grep "cherry" ~/bin/c
|
grep "cherry" ~/bin/c
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'setup 3' '
|
||||||
|
rm -rf ~/bin &&
|
||||||
|
echo "dot_apple" > ${DOTFILES}/bin/.a &&
|
||||||
|
echo "dot_banana" > ${DOTFILES}/bin/.b &&
|
||||||
|
echo "dot_cherry" > ${DOTFILES}/bin/.c
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success 'run 3' '
|
||||||
|
run_dotbot -v <<EOF
|
||||||
|
- defaults:
|
||||||
|
link:
|
||||||
|
glob: true
|
||||||
|
create: true
|
||||||
|
- link:
|
||||||
|
~/bin/: bin/.*
|
||||||
|
EOF
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success 'test 3' '
|
||||||
|
grep "dot_apple" ~/bin/.a &&
|
||||||
|
grep "dot_banana" ~/bin/.b &&
|
||||||
|
grep "dot_cherry" ~/bin/.c
|
||||||
|
'
|
||||||
|
|
Loading…
Reference in a new issue