1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-10 23:09:16 +00:00

fix tests notemplate

This commit is contained in:
deadc0de6
2020-10-09 22:48:04 +02:00
parent cfc0f92f10
commit 11f6a98d9c

View File

@@ -107,27 +107,28 @@ echo "after" >> ${tmps}/dotfiles/f1
# create the directory # create the directory
mkdir -p ${tmps}/dotfiles/dir1/d1 mkdir -p ${tmps}/dotfiles/dir1/d1
echo "{{@@ header() @@}}" >> ${tmps}/dotfiles/dir1/d1/f2 echo "{{@@ header() @@}}" > ${tmps}/dotfiles/dir1/d1/f2
# create the linked directory # create the linked directory
mkdir -p ${tmps}/dotfiles/dir2/d1 mkdir -p ${tmps}/dotfiles/dir2/d1
echo "{{@@ header() @@}}" >> ${tmps}/dotfiles/dir2/d1/f2 echo "{{@@ header() @@}}" > ${tmps}/dotfiles/dir2/d1/f2
# create the link_children directory # create the link_children directory
mkdir -p ${tmps}/dotfiles/dir3/{s1,s2,s3} mkdir -p ${tmps}/dotfiles/dir3/{s1,s2,s3}
echo "{{@@ header() @@}}" >> ${tmps}/dotfiles/dir3/s1/f1 echo "{{@@ header() @@}}" > ${tmps}/dotfiles/dir3/s1/f1
echo "{{@@ header() @@}}" >> ${tmps}/dotfiles/dir3/s2/f2 echo "{{@@ header() @@}}" > ${tmps}/dotfiles/dir3/s2/f2
# create the linked dotfile # create the linked dotfile
echo "{{@@ header() @@}}" >> ${tmps}/dotfiles/fl echo "{{@@ header() @@}}" > ${tmps}/dotfiles/fl
# create the normal dotfile # create the normal dotfile
echo "before" > ${tmps}/dotfiles/fn echo "before" > ${tmps}/dotfiles/fn
echo "{#@@ should not be stripped @@#}" >> ${tmps}/dotfiles/fn echo "{#@@ should not be stripped @@#}" >> ${tmps}/dotfiles/fn
echo "after" > ${tmps}/dotfiles/fn echo "after" >> ${tmps}/dotfiles/fn
# install # install
cd ${ddpath} | ${bin} install -f -c ${cfg} -p p1 -V cd ${ddpath} | ${bin} install -f --showdiff -c ${cfg} -p p1 -V
cd ${ddpath} | ${bin} compare -c ${cfg} -p p1 -V
# simple file # simple file
echo "doing globally" echo "doing globally"
@@ -171,6 +172,17 @@ echo "* normal dotfile"
[ ! -e ${tmpd}/fn ] && echo 'not installed' && exit 1 [ ! -e ${tmpd}/fn ] && echo 'not installed' && exit 1
grep 'should not be stripped' ${tmpd}/fn && echo "no templated" && exit 1 grep 'should not be stripped' ${tmpd}/fn && echo "no templated" && exit 1
# test backup done
echo "before" > ${tmps}/dotfiles/f1
cd ${ddpath} | ${bin} install -f --showdiff -c ${cfg} -p p1 -V
[ ! -e ${tmpd}/f1.dotdropbak ] && echo "backup not done" && exit 1
# re-create the dotfile
echo "before" > ${tmps}/dotfiles/f1
echo "{#@@ should not be stripped @@#}" >> ${tmps}/dotfiles/f1
echo "{{@@ header() @@}}" >> ${tmps}/dotfiles/f1
echo "after" >> ${tmps}/dotfiles/f1
# through the dotfile # through the dotfile
cat > ${cfg} << _EOF cat > ${cfg} << _EOF
config: config:
@@ -221,7 +233,8 @@ _EOF
rm -rf ${tmpd}/* rm -rf ${tmpd}/*
# install # install
cd ${ddpath} | ${bin} install -f -c ${cfg} -p p1 -V cd ${ddpath} | ${bin} install -f --showdiff -c ${cfg} -p p1 -V
cd ${ddpath} | ${bin} compare -c ${cfg} -p p1 -V
# simple file # simple file
echo "doing specifically" echo "doing specifically"
@@ -265,6 +278,7 @@ echo "* normal dotfile"
[ ! -e ${tmpd}/fn ] && echo 'not installed' && exit 1 [ ! -e ${tmpd}/fn ] && echo 'not installed' && exit 1
grep 'should not be stripped' ${tmpd}/fn && echo "no templated" && exit 1 grep 'should not be stripped' ${tmpd}/fn && echo "no templated" && exit 1
## CLEANING ## CLEANING
rm -rf ${tmps} ${tmpd} rm -rf ${tmps} ${tmpd}