1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 23:14:47 +00:00

test for undefined workdir

This commit is contained in:
deadc0de6
2018-12-27 11:04:01 +01:00
parent 8feb417ff6
commit 270a532878

View File

@@ -156,5 +156,56 @@ grep -r ${string} ${tmpw} >/dev/null
## CLEANING
rm -rf ${tmp} ${tmpd}
## NONE
echo "RUNNING UNDEFINED WORKDIR"
# the dotfile source
tmp=`mktemp -d`
tmpf="${tmp}/dotfiles"
mkdir -p ${tmpf}
echo "dotfiles source (dotpath): ${tmpf}"
# create the config file
cfg="${tmp}/config.yaml"
echo "config file: ${cfg}"
# the dotfile destination
tmpd=`mktemp -d`
echo "dotfiles destination: ${tmpd}"
cat > ${cfg} << _EOF
config:
backup: true
create: true
dotpath: dotfiles
dotfiles:
f_abc:
dst: ${tmpd}/abc
src: abc
link: true
profiles:
p1:
dotfiles:
- f_abc
_EOF
cat ${cfg}
# create the dotfile
echo "{{@@ profile @@}}" > ${tmpf}/abc
echo "${string}" >> ${tmpf}/abc
# install
cd ${ddpath} | ${bin} install -f -c ${cfg} -p p1 -b -V
# checks
#grep -r p1 ${tmpw} >/dev/null
#grep -r ${string} ${tmpw} >/dev/null
[ ! -e ${tmpd}/abc ] && echo "[ERROR] dotfile not installed" && exit 1
[ ! -h ${tmpd}/abc ] && echo "[ERROR] dotfile is not a symlink" && exit 1
## CLEANING
rm -rf ${tmp} ${tmpd}
echo "OK"
exit 0