1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 19:44:45 +00:00

add test for bug #226

This commit is contained in:
deadc0de6
2020-05-03 18:47:32 +02:00
parent aab4492556
commit 7f1cac74a3

View File

@@ -99,10 +99,14 @@ dotfiles:
f_ghi:
dst: ${tmpd}/ghi
src: ghi
f_asub:
dst: ${tmpd}/subdir/sub/asub
src: subdir/sub/asub
profiles:
p2:
dotfiles:
- f_def
- f_asub
psubsub:
dotfiles:
- f_sub
@@ -125,6 +129,10 @@ echo "{{@@ _dotfile_abs_dst @@}}" >> ${tmps}/dotfiles/zzz
echo "sub" > ${tmps}/dotfiles/sub
echo "{{@@ _dotfile_abs_dst @@}}" >> ${tmps}/dotfiles/sub
mkdir -p ${tmps}/dotfiles-other/subdir/sub
echo "subsub" > ${tmps}/dotfiles-other/subdir/sub/asub
echo "{{@@ _dotfile_abs_dst @@}}" >> ${tmps}/dotfiles-other/subdir/sub/asub
# install
cd ${ddpath} | ${bin} files -c ${cfg1} -p p0 -V | grep f_def
cd ${ddpath} | ${bin} files -c ${cfg1} -p p1 -V | grep f_abc
@@ -137,6 +145,35 @@ cd ${ddpath} | ${bin} files -c ${cfg1} -p psubsub -V | grep f_sub
cd ${ddpath} | ${bin} install -c ${cfg1} -p p2 -V
cd ${ddpath} | ${bin} compare -c ${cfg1} -p p2 -V
# test with non-existing dotpath this time
rm -rf ${tmps}/dotfiles
cat > ${cfg1} << _EOF
config:
backup: true
create: true
dotpath: dotfiles
import_configs:
- ${cfg2}
dotfiles:
profiles:
_EOF
cat > ${cfg2} << _EOF
config:
backup: true
create: true
dotpath: dotfiles-other
dotfiles:
f_asub:
dst: ${tmpd}/subdir/sub/asub
src: subdir/sub/asub
profiles:
p2:
dotfiles:
- f_asub
_EOF
cd ${ddpath} | ${bin} install -c ${cfg1} -p p2 -V
cd ${ddpath} | ${bin} compare -c ${cfg1} -p p2 -V
## CLEANING
rm -rf ${tmps} ${tmpd}