1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 15:39:43 +00:00

update tests

This commit is contained in:
deadc0de6
2020-12-11 19:44:44 +01:00
parent 1cde6c0988
commit f6ac82082f
2 changed files with 9 additions and 5 deletions

View File

@@ -145,31 +145,39 @@ cd ${ddpath} | ${bin} import -c ${cfg} -l link_children -p p1 ${tmpd}/nvim
# add sub dir
mkdir -p ${tmpd}/nvim/templated
echo "noprofile" > ${tmpd}/nvim/templated/ftemplated
echo "noprofile" > ${tmpd}/nvim/template
echo "[+] import sub"
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 ${tmpd}/nvim/templated
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 ${tmpd}/nvim/template
cfg2="${basedir}/config2.yaml"
sed '/d_nvim:/a \ \ \ \ instignore:\n\ \ \ \ - "*templated*"' ${cfg} > ${cfg2}
sed '/d_nvim:/a \ \ \ \ instignore:\n\ \ \ \ - "*template*"' ${cfg} > ${cfg2}
cat ${cfg2}
## clean destination files
rm -rf ${tmpd}/nvim
## patch template file
echo "{{@@ profile @@}}" > ${tmps}/dotfiles/${tmpd}/nvim/templated/ftemplated
echo "{{@@ profile @@}}" > ${tmps}/dotfiles/${tmpd}/nvim/template
echo "[+] install link_children"
cd ${ddpath} | ${bin} install -f -c ${cfg2} -p p1 -V d_nvim
[ -d ${tmpd}/nvim/templated ] && echo "templated should not be installed" && exit 1
[ -e ${tmpd}/nvim/templated/ftemplated ] && echo "templated file should not be installed" && exit 1
[ -e ${tmpd}/nvim/template ] && echo "template file should not be installed" && exit 1
echo "[+] install sub"
cd ${ddpath} | ${bin} install -f -c ${cfg2} -p p1 -V d_templated
echo "[+] install template"
cd ${ddpath} | ${bin} install -f -c ${cfg2} -p p1 -V f_template
[ ! -d ${tmpd}/nvim/templated ] && echo "templated not installed" && exit 1
[ ! -e ${tmpd}/nvim/templated/ftemplated ] && echo "templated file not installed" && exit 1
[ ! -e ${tmpd}/nvim/template ] && echo "template file not installed" && exit 1
grep 'p1' ${tmpd}/nvim/templated/ftemplated
grep 'p1' ${tmpd}/nvim/template
## CLEANING
rm -rf ${basedir} ${tmpd}

View File

@@ -98,14 +98,10 @@ echo 'b' > ${tmpd}/a/c/acfile
mkdir -p ${tmpd}/a/newdir/b
touch ${tmpd}/a/newdir/b/c
#tree ${tmpd}/a
# update
echo "[+] update"
cd ${ddpath} | ${bin} update -f -c ${cfg} --verbose --profile=p1 --key f_abc
#tree ${dt}
# check files haven't been updated
grep_or_fail 'b' "${dt}/a/c/acfile"
[ -e ${dt}/a/newfile ] && echo "should not have been updated" && exit 1