1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-11 07:19:16 +00:00

make sure tests are able to create tmp directory

This commit is contained in:
deadc0de6
2019-07-02 23:36:34 +02:00
parent ecd27d3b60
commit 49275d371d
63 changed files with 153 additions and 153 deletions

View File

@@ -48,11 +48,11 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename $BASH_SOURCE) <==$(tput sgr0)"
################################################################
# the dotfile source
tmps=`mktemp -d --suffix='-dotdrop-tests'`
tmps=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d`
mkdir -p ${tmps}/dotfiles
echo "dotfiles source (dotpath): ${tmps}"
# the dotfile destination
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d`
echo "dotfiles destination: ${tmpd}"
# create the config file
@@ -98,7 +98,7 @@ _EOF
#cat ${cfg}
# create the base64 dotfile
tmpf=`mktemp --suffix='-dotdrop-tests'`
tmpf=`mktemp --suffix='-dotdrop-tests' || mktemp -d`
echo ${token} > ${tmpf}
cat ${tmpf} | base64 > ${tmps}/dotfiles/abc
rm -f ${tmpf}
@@ -107,7 +107,7 @@ rm -f ${tmpf}
echo 'marker' > ${tmps}/dotfiles/def
# create the compressed dotfile
tmpx=`mktemp -d --suffix='-dotdrop-tests'`
tmpx=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d`
mkdir -p ${tmpx}/{a,b,c}
mkdir -p ${tmpx}/a/{dir1,dir2}
# ambiguous redirect ??
@@ -191,7 +191,7 @@ cd ${ddpath} | ${bin} update -f -k -c ${cfg} -p p1 -b -V d_ghi
tar -tf ${tmps}/dotfiles/ghi | grep './b/newfile'
tar -tf ${tmps}/dotfiles/ghi | grep './a/dir1/otherfile'
tmpy=`mktemp -d --suffix='-dotdrop-tests'`
tmpy=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d`
tar -xf ${tmps}/dotfiles/ghi -C ${tmpy}
content=`cat ${tmpy}/a/somefile`
[ "${content}" != "${touched}" ] && exit 1