mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-11 16:04:00 +00:00
update tests
This commit is contained in:
@@ -46,12 +46,12 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# the action temp
|
# the action temp
|
||||||
tmpa=`mktemp -d`
|
tmpa=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
# the dotfile source
|
# the dotfile source
|
||||||
tmps=`mktemp -d`
|
tmps=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
mkdir -p ${tmps}/dotfiles
|
mkdir -p ${tmps}/dotfiles
|
||||||
# the dotfile destination
|
# the dotfile destination
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
|
|
||||||
# create the config file
|
# create the config file
|
||||||
cfg="${tmps}/config.yaml"
|
cfg="${tmps}/config.yaml"
|
||||||
|
|||||||
@@ -46,12 +46,12 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# the action temp
|
# the action temp
|
||||||
tmpa=`mktemp -d`
|
tmpa=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
# the dotfile source
|
# the dotfile source
|
||||||
tmps=`mktemp -d`
|
tmps=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
mkdir -p ${tmps}/dotfiles
|
mkdir -p ${tmps}/dotfiles
|
||||||
# the dotfile destination
|
# the dotfile destination
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
|
|
||||||
# create the config file
|
# create the config file
|
||||||
cfg="${tmps}/config.yaml"
|
cfg="${tmps}/config.yaml"
|
||||||
|
|||||||
@@ -46,12 +46,12 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# the action temp
|
# the action temp
|
||||||
tmpa=`mktemp -d`
|
tmpa=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
# the dotfile source
|
# the dotfile source
|
||||||
tmps=`mktemp -d`
|
tmps=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
mkdir -p ${tmps}/dotfiles
|
mkdir -p ${tmps}/dotfiles
|
||||||
# the dotfile destination
|
# the dotfile destination
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
|
|
||||||
# create the config file
|
# create the config file
|
||||||
cfg="${tmps}/config.yaml"
|
cfg="${tmps}/config.yaml"
|
||||||
|
|||||||
@@ -46,12 +46,12 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# dotdrop directory
|
# dotdrop directory
|
||||||
basedir=`mktemp -d`
|
basedir=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
echo "[+] dotdrop dir: ${basedir}"
|
echo "[+] dotdrop dir: ${basedir}"
|
||||||
echo "[+] dotpath dir: ${basedir}/dotfiles"
|
echo "[+] dotpath dir: ${basedir}/dotfiles"
|
||||||
|
|
||||||
# the dotfile to be imported
|
# the dotfile to be imported
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
|
|
||||||
# some files
|
# some files
|
||||||
mkdir -p ${tmpd}/{program,config}
|
mkdir -p ${tmpd}/{program,config}
|
||||||
|
|||||||
@@ -46,12 +46,12 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# dotdrop directory
|
# dotdrop directory
|
||||||
basedir=`mktemp -d`
|
basedir=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
echo "[+] dotdrop dir: ${basedir}"
|
echo "[+] dotdrop dir: ${basedir}"
|
||||||
echo "[+] dotpath dir: ${basedir}/dotfiles"
|
echo "[+] dotpath dir: ${basedir}/dotfiles"
|
||||||
|
|
||||||
# the dotfile to be imported
|
# the dotfile to be imported
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
|
|
||||||
# single file
|
# single file
|
||||||
echo 'unique' > ${tmpd}/uniquefile
|
echo 'unique' > ${tmpd}/uniquefile
|
||||||
|
|||||||
@@ -46,11 +46,11 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# dotdrop directory
|
# dotdrop directory
|
||||||
basedir=`mktemp -d`
|
basedir=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
dotfiles="${basedir}/dotfiles"
|
dotfiles="${basedir}/dotfiles"
|
||||||
echo "dotdrop dir: ${basedir}"
|
echo "dotdrop dir: ${basedir}"
|
||||||
# the dotfile
|
# the dotfile
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
create_dir ${tmpd}
|
create_dir ${tmpd}
|
||||||
|
|
||||||
# create the config file
|
# create the config file
|
||||||
|
|||||||
@@ -46,10 +46,10 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# the dotfile source
|
# the dotfile source
|
||||||
tmps=`mktemp -d`
|
tmps=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
mkdir -p ${tmps}/dotfiles
|
mkdir -p ${tmps}/dotfiles
|
||||||
# the dotfile destination
|
# the dotfile destination
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
|
|
||||||
# create the config file
|
# create the config file
|
||||||
cfg="${tmps}/config.yaml"
|
cfg="${tmps}/config.yaml"
|
||||||
|
|||||||
@@ -46,12 +46,12 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# the action temp
|
# the action temp
|
||||||
tmpa=`mktemp -d`
|
tmpa=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
# the dotfile source
|
# the dotfile source
|
||||||
tmps=`mktemp -d`
|
tmps=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
mkdir -p ${tmps}/dotfiles
|
mkdir -p ${tmps}/dotfiles
|
||||||
# the dotfile destination
|
# the dotfile destination
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
|
|
||||||
# create the config file
|
# create the config file
|
||||||
cfg="${tmps}/config.yaml"
|
cfg="${tmps}/config.yaml"
|
||||||
|
|||||||
@@ -46,10 +46,10 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# the dotfile source
|
# the dotfile source
|
||||||
tmps=`mktemp -d`
|
tmps=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
mkdir -p ${tmps}/dotfiles
|
mkdir -p ${tmps}/dotfiles
|
||||||
# the dotfile destination
|
# the dotfile destination
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
|
|
||||||
# create the config file
|
# create the config file
|
||||||
cfg="${tmps}/config.yaml"
|
cfg="${tmps}/config.yaml"
|
||||||
|
|||||||
@@ -46,15 +46,15 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# the dotfile source
|
# the dotfile source
|
||||||
tmps=`mktemp -d`
|
tmps=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
mkdir -p ${tmps}/dotfiles
|
mkdir -p ${tmps}/dotfiles
|
||||||
# the dotfile destination
|
# the dotfile destination
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
#echo "dotfile destination: ${tmpd}"
|
#echo "dotfile destination: ${tmpd}"
|
||||||
|
|
||||||
# create a shell script
|
# create a shell script
|
||||||
export TESTENV="this is my testenv"
|
export TESTENV="this is my testenv"
|
||||||
scr=`mktemp`
|
scr=`mktemp --suffix='-dotdrop-tests'`
|
||||||
chmod +x ${scr}
|
chmod +x ${scr}
|
||||||
echo -e "#!/bin/bash\necho $TESTENV\n" >> ${scr}
|
echo -e "#!/bin/bash\necho $TESTENV\n" >> ${scr}
|
||||||
|
|
||||||
|
|||||||
@@ -46,11 +46,11 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# the dotfile source
|
# the dotfile source
|
||||||
tmps=`mktemp -d`
|
tmps=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
mkdir -p ${tmps}/dotfiles
|
mkdir -p ${tmps}/dotfiles
|
||||||
#echo "dotfile source: ${tmps}"
|
#echo "dotfile source: ${tmps}"
|
||||||
# the dotfile destination
|
# the dotfile destination
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
#echo "dotfile destination: ${tmpd}"
|
#echo "dotfile destination: ${tmpd}"
|
||||||
|
|
||||||
# create the config file
|
# create the config file
|
||||||
|
|||||||
@@ -46,11 +46,11 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# the dotfile source
|
# the dotfile source
|
||||||
tmps=`mktemp -d`
|
tmps=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
mkdir -p ${tmps}/dotfiles
|
mkdir -p ${tmps}/dotfiles
|
||||||
#echo "dotfile source: ${tmps}"
|
#echo "dotfile source: ${tmps}"
|
||||||
# the dotfile destination
|
# the dotfile destination
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
#echo "dotfile destination: ${tmpd}"
|
#echo "dotfile destination: ${tmpd}"
|
||||||
|
|
||||||
# create the config file
|
# create the config file
|
||||||
|
|||||||
@@ -46,10 +46,10 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# the dotfile source
|
# the dotfile source
|
||||||
tmps=`mktemp -d`
|
tmps=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
mkdir -p ${tmps}/dotfiles
|
mkdir -p ${tmps}/dotfiles
|
||||||
# the dotfile destination
|
# the dotfile destination
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
|
|
||||||
# create the config file
|
# create the config file
|
||||||
cfg="${tmps}/config.yaml"
|
cfg="${tmps}/config.yaml"
|
||||||
|
|||||||
@@ -46,10 +46,10 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# the dotfile source
|
# the dotfile source
|
||||||
tmps=`mktemp -d`
|
tmps=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
mkdir -p ${tmps}/dotfiles
|
mkdir -p ${tmps}/dotfiles
|
||||||
# the dotfile destination
|
# the dotfile destination
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
#echo "dotfile destination: ${tmpd}"
|
#echo "dotfile destination: ${tmpd}"
|
||||||
|
|
||||||
# create the config file
|
# create the config file
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# the dotfile source
|
# the dotfile source
|
||||||
tmps=`mktemp -d`
|
tmps=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
mkdir -p ${tmps}/dotfiles
|
mkdir -p ${tmps}/dotfiles
|
||||||
echo "dotfiles source (dotpath): ${tmps}"
|
echo "dotfiles source (dotpath): ${tmps}"
|
||||||
# the dotfile destination
|
# the dotfile destination
|
||||||
|
|||||||
@@ -46,14 +46,14 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# the dotfile source
|
# the dotfile source
|
||||||
tmps=`mktemp -d`
|
tmps=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
mkdir -p ${tmps}/dotfiles
|
mkdir -p ${tmps}/dotfiles
|
||||||
echo "dotfiles source (dotpath): ${tmps}"
|
echo "dotfiles source (dotpath): ${tmps}"
|
||||||
# the dotfile destination
|
# the dotfile destination
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
echo "dotfiles destination: ${tmpd}"
|
echo "dotfiles destination: ${tmpd}"
|
||||||
# the workdir
|
# the workdir
|
||||||
tmpw=`mktemp -d`
|
tmpw=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
echo "workdir: ${tmpw}"
|
echo "workdir: ${tmpw}"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -46,14 +46,14 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# the dotfile source
|
# the dotfile source
|
||||||
tmps=`mktemp -d`
|
tmps=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
mkdir -p ${tmps}/dotfiles
|
mkdir -p ${tmps}/dotfiles
|
||||||
echo "dotfiles source (dotpath): ${tmps}"
|
echo "dotfiles source (dotpath): ${tmps}"
|
||||||
# the dotfile destination
|
# the dotfile destination
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
echo "dotfiles destination: ${tmpd}"
|
echo "dotfiles destination: ${tmpd}"
|
||||||
# the workdir
|
# the workdir
|
||||||
tmpw=`mktemp -d`
|
tmpw=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
echo "workdir: ${tmpw}"
|
echo "workdir: ${tmpw}"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -46,20 +46,20 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# the dotfile source
|
# the dotfile source
|
||||||
tmps=`mktemp -d`
|
tmps=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
mkdir -p ${tmps}/dotfiles
|
mkdir -p ${tmps}/dotfiles
|
||||||
# the dotfile destination
|
# the dotfile destination
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
#echo "dotfile destination: ${tmpd}"
|
#echo "dotfile destination: ${tmpd}"
|
||||||
|
|
||||||
# create a shell script
|
# create a shell script
|
||||||
export TESTENV="this is my global testenv"
|
export TESTENV="this is my global testenv"
|
||||||
scr=`mktemp`
|
scr=`mktemp --suffix='-dotdrop-tests'`
|
||||||
chmod +x ${scr}
|
chmod +x ${scr}
|
||||||
echo -e "#!/bin/bash\necho $TESTENV\n" >> ${scr}
|
echo -e "#!/bin/bash\necho $TESTENV\n" >> ${scr}
|
||||||
|
|
||||||
export TESTENV2="this is my profile testenv"
|
export TESTENV2="this is my profile testenv"
|
||||||
scr2=`mktemp`
|
scr2=`mktemp --suffix='-dotdrop-tests'`
|
||||||
chmod +x ${scr2}
|
chmod +x ${scr2}
|
||||||
echo -e "#!/bin/bash\necho $TESTENV2\n" >> ${scr2}
|
echo -e "#!/bin/bash\necho $TESTENV2\n" >> ${scr2}
|
||||||
|
|
||||||
|
|||||||
@@ -46,10 +46,10 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# the dotfile source
|
# the dotfile source
|
||||||
tmps=`mktemp -d`
|
tmps=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
mkdir -p ${tmps}/dotfiles
|
mkdir -p ${tmps}/dotfiles
|
||||||
# the dotfile destination
|
# the dotfile destination
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
#echo "dotfile destination: ${tmpd}"
|
#echo "dotfile destination: ${tmpd}"
|
||||||
|
|
||||||
# create the config file
|
# create the config file
|
||||||
|
|||||||
@@ -48,11 +48,11 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# the dotfile source
|
# the dotfile source
|
||||||
tmps=`mktemp -d`
|
tmps=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
mkdir -p ${tmps}/dotfiles
|
mkdir -p ${tmps}/dotfiles
|
||||||
echo "dotfiles source (dotpath): ${tmps}"
|
echo "dotfiles source (dotpath): ${tmps}"
|
||||||
# the dotfile destination
|
# the dotfile destination
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
echo "dotfiles destination: ${tmpd}"
|
echo "dotfiles destination: ${tmpd}"
|
||||||
|
|
||||||
# create the config file
|
# create the config file
|
||||||
@@ -98,7 +98,7 @@ _EOF
|
|||||||
cat ${cfg}
|
cat ${cfg}
|
||||||
|
|
||||||
# create the base64 dotfile
|
# create the base64 dotfile
|
||||||
tmpf=`mktemp`
|
tmpf=`mktemp --suffix='-dotdrop-tests'`
|
||||||
echo ${token} > ${tmpf}
|
echo ${token} > ${tmpf}
|
||||||
cat ${tmpf} | base64 > ${tmps}/dotfiles/abc
|
cat ${tmpf} | base64 > ${tmps}/dotfiles/abc
|
||||||
rm -f ${tmpf}
|
rm -f ${tmpf}
|
||||||
@@ -107,7 +107,7 @@ rm -f ${tmpf}
|
|||||||
echo 'marker' > ${tmps}/dotfiles/def
|
echo 'marker' > ${tmps}/dotfiles/def
|
||||||
|
|
||||||
# create the compressed dotfile
|
# create the compressed dotfile
|
||||||
tmpx=`mktemp -d`
|
tmpx=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
mkdir -p ${tmpx}/{a,b,c}
|
mkdir -p ${tmpx}/{a,b,c}
|
||||||
mkdir -p ${tmpx}/a/{dir1,dir2}
|
mkdir -p ${tmpx}/a/{dir1,dir2}
|
||||||
# ambiguous redirect ??
|
# ambiguous redirect ??
|
||||||
@@ -184,7 +184,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 './b/newfile'
|
||||||
tar -tf ${tmps}/dotfiles/ghi | grep './a/dir1/otherfile'
|
tar -tf ${tmps}/dotfiles/ghi | grep './a/dir1/otherfile'
|
||||||
|
|
||||||
tmpy=`mktemp -d`
|
tmpy=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
tar -xf ${tmps}/dotfiles/ghi -C ${tmpy}
|
tar -xf ${tmps}/dotfiles/ghi -C ${tmpy}
|
||||||
content=`cat ${tmpy}/a/somefile`
|
content=`cat ${tmpy}/a/somefile`
|
||||||
[ "${content}" != "${touched}" ] && exit 1
|
[ "${content}" != "${touched}" ] && exit 1
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# dotdrop directory
|
# dotdrop directory
|
||||||
tmps=`mktemp -d`
|
tmps=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
dt="${tmps}/dotfiles"
|
dt="${tmps}/dotfiles"
|
||||||
mkdir -p ${dt}
|
mkdir -p ${dt}
|
||||||
mkdir -p ${dt}/a/{b,c}
|
mkdir -p ${dt}/a/{b,c}
|
||||||
@@ -54,7 +54,7 @@ echo 'a' > ${dt}/a/b/abfile
|
|||||||
echo 'a' > ${dt}/a/c/acfile
|
echo 'a' > ${dt}/a/c/acfile
|
||||||
|
|
||||||
# fs dotfiles
|
# fs dotfiles
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
cp -r ${dt}/a ${tmpd}/
|
cp -r ${dt}/a ${tmpd}/
|
||||||
|
|
||||||
# create the config file
|
# create the config file
|
||||||
|
|||||||
@@ -46,14 +46,14 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# the dotfile source
|
# the dotfile source
|
||||||
tmps=`mktemp -d`
|
tmps=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
mkdir -p ${tmps}/dotfiles
|
mkdir -p ${tmps}/dotfiles
|
||||||
echo "dotfiles source (dotpath): ${tmps}"
|
echo "dotfiles source (dotpath): ${tmps}"
|
||||||
# the dotfile destination
|
# the dotfile destination
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
echo "dotfiles destination: ${tmpd}"
|
echo "dotfiles destination: ${tmpd}"
|
||||||
# the workdir
|
# the workdir
|
||||||
tmpw=`mktemp -d`
|
tmpw=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
echo "workdir: ${tmpw}"
|
echo "workdir: ${tmpw}"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -46,12 +46,12 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# dotdrop directory
|
# dotdrop directory
|
||||||
basedir=`mktemp -d`
|
basedir=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
echo "[+] dotdrop dir: ${basedir}"
|
echo "[+] dotdrop dir: ${basedir}"
|
||||||
echo "[+] dotpath dir: ${basedir}/dotfiles"
|
echo "[+] dotpath dir: ${basedir}/dotfiles"
|
||||||
|
|
||||||
# the dotfile to be imported
|
# the dotfile to be imported
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
|
|
||||||
# originally imported directory
|
# originally imported directory
|
||||||
echo 'unique' > ${tmpd}/uniquefile
|
echo 'unique' > ${tmpd}/uniquefile
|
||||||
|
|||||||
@@ -46,12 +46,12 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# dotdrop directory
|
# dotdrop directory
|
||||||
basedir=`mktemp -d`
|
basedir=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
echo "[+] dotdrop dir: ${basedir}"
|
echo "[+] dotdrop dir: ${basedir}"
|
||||||
echo "[+] dotpath dir: ${basedir}/dotfiles"
|
echo "[+] dotpath dir: ${basedir}/dotfiles"
|
||||||
|
|
||||||
# the dotfile to be imported
|
# the dotfile to be imported
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
|
|
||||||
# single file
|
# single file
|
||||||
echo 'unique' > ${tmpd}/uniquefile
|
echo 'unique' > ${tmpd}/uniquefile
|
||||||
|
|||||||
@@ -46,11 +46,11 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# the dotfile source
|
# the dotfile source
|
||||||
tmps=`mktemp -d`
|
tmps=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
mkdir -p ${tmps}/dotfiles
|
mkdir -p ${tmps}/dotfiles
|
||||||
#echo "dotfile source: ${tmps}"
|
#echo "dotfile source: ${tmps}"
|
||||||
# the dotfile destination
|
# the dotfile destination
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
#echo "dotfile destination: ${tmpd}"
|
#echo "dotfile destination: ${tmpd}"
|
||||||
|
|
||||||
# create the config file
|
# create the config file
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ echo -e "\e[96m\e[1m==> RUNNING $(basename $BASH_SOURCE) <==\e[0m"
|
|||||||
string="blabla"
|
string="blabla"
|
||||||
|
|
||||||
# the dotfile source
|
# the dotfile source
|
||||||
tmp=`mktemp -d`
|
tmp=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
|
|
||||||
tmpf="${tmp}/dotfiles"
|
tmpf="${tmp}/dotfiles"
|
||||||
tmpw="${tmp}/workdir"
|
tmpw="${tmp}/workdir"
|
||||||
@@ -62,7 +62,7 @@ cfg="${tmp}/config.yaml"
|
|||||||
echo "config file: ${cfg}"
|
echo "config file: ${cfg}"
|
||||||
|
|
||||||
# the dotfile destination
|
# the dotfile destination
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
echo "dotfiles destination: ${tmpd}"
|
echo "dotfiles destination: ${tmpd}"
|
||||||
|
|
||||||
## RELATIVE
|
## RELATIVE
|
||||||
@@ -104,7 +104,7 @@ rm -rf ${tmp} ${tmpd}
|
|||||||
## ABSOLUTE
|
## ABSOLUTE
|
||||||
echo "RUNNING ABSOLUTE"
|
echo "RUNNING ABSOLUTE"
|
||||||
# the dotfile source
|
# the dotfile source
|
||||||
tmp=`mktemp -d`
|
tmp=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
|
|
||||||
tmpf="${tmp}/dotfiles"
|
tmpf="${tmp}/dotfiles"
|
||||||
tmpw="${tmp}/workdir"
|
tmpw="${tmp}/workdir"
|
||||||
@@ -119,7 +119,7 @@ cfg="${tmp}/config.yaml"
|
|||||||
echo "config file: ${cfg}"
|
echo "config file: ${cfg}"
|
||||||
|
|
||||||
# the dotfile destination
|
# the dotfile destination
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
echo "dotfiles destination: ${tmpd}"
|
echo "dotfiles destination: ${tmpd}"
|
||||||
|
|
||||||
cat > ${cfg} << _EOF
|
cat > ${cfg} << _EOF
|
||||||
@@ -159,7 +159,7 @@ rm -rf ${tmp} ${tmpd}
|
|||||||
## NONE
|
## NONE
|
||||||
echo "RUNNING UNDEFINED WORKDIR"
|
echo "RUNNING UNDEFINED WORKDIR"
|
||||||
# the dotfile source
|
# the dotfile source
|
||||||
tmp=`mktemp -d`
|
tmp=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
|
|
||||||
tmpf="${tmp}/dotfiles"
|
tmpf="${tmp}/dotfiles"
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ cfg="${tmp}/config.yaml"
|
|||||||
echo "config file: ${cfg}"
|
echo "config file: ${cfg}"
|
||||||
|
|
||||||
# the dotfile destination
|
# the dotfile destination
|
||||||
tmpd=`mktemp -d`
|
tmpd=`mktemp -d --suffix='-dotdrop-tests'`
|
||||||
echo "dotfiles destination: ${tmpd}"
|
echo "dotfiles destination: ${tmpd}"
|
||||||
|
|
||||||
cat > ${cfg} << _EOF
|
cat > ${cfg} << _EOF
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ def get_string(length):
|
|||||||
|
|
||||||
def get_tempdir():
|
def get_tempdir():
|
||||||
"""Get a temporary directory"""
|
"""Get a temporary directory"""
|
||||||
return tempfile.mkdtemp(suffix=TMPSUFFIX)
|
return tempfile.mkdtemp(prefix='dotdrop-tests-')
|
||||||
|
|
||||||
|
|
||||||
def create_random_file(directory, content=None,
|
def create_random_file(directory, content=None,
|
||||||
|
|||||||
Reference in New Issue
Block a user