From 49275d371d97a2cda9884c2c9ae204f2042fde30 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Tue, 2 Jul 2019 23:36:34 +0200 Subject: [PATCH] make sure tests are able to create tmp directory --- tests-ng/actions-args-template.sh | 6 +++--- tests-ng/actions-args.sh | 6 +++--- tests-ng/actions-default.sh | 6 +++--- tests-ng/actions-pre.sh | 6 +++--- tests-ng/actions-template.sh | 6 +++--- tests-ng/actions.sh | 6 +++--- tests-ng/compare-ignore-relative.sh | 4 ++-- tests-ng/compare-ignore.sh | 4 ++-- tests-ng/compare.sh | 4 ++-- tests-ng/deprecated-link.sh | 4 ++-- tests-ng/dir-import-update.sh | 4 ++-- tests-ng/dotdrop-variables.sh | 4 ++-- tests-ng/dotfile-no-src.sh | 4 ++-- tests-ng/dotfile-sub-variables.sh | 4 ++-- tests-ng/dotfile-variables.sh | 4 ++-- tests-ng/dotfiles-all.sh | 4 ++-- tests-ng/dotfiles-dyn-paths.sh | 4 ++-- tests-ng/duplicate-key.sh | 4 ++-- tests-ng/dynactions.sh | 6 +++--- tests-ng/dyndotfilepaths.sh | 4 ++-- tests-ng/dynextvariables.sh | 4 ++-- tests-ng/dyninclude.sh | 4 ++-- tests-ng/dynvariables.sh | 6 +++--- tests-ng/ext-actions.sh | 6 +++--- tests-ng/extvariables.sh | 4 ++-- tests-ng/force-actions.sh | 6 +++--- tests-ng/global-compare-ignore.sh | 4 ++-- tests-ng/global-update-ignore.sh | 4 ++-- tests-ng/globs.sh | 6 +++--- tests-ng/header.sh | 4 ++-- tests-ng/ignore-empty.sh | 4 ++-- tests-ng/import-configs.sh | 4 ++-- tests-ng/import-duplicate.sh | 4 ++-- tests-ng/import-link-children.sh | 4 ++-- tests-ng/import-profile-dotfiles.sh | 4 ++-- tests-ng/import-subfile.sh | 4 ++-- tests-ng/import.sh | 4 ++-- tests-ng/imported-configs-variables.sh | 4 ++-- tests-ng/include-actions.sh | 6 +++--- tests-ng/include-order.sh | 6 +++--- tests-ng/include.sh | 4 ++-- tests-ng/inst-link-default.sh | 4 ++-- tests-ng/jhelpers.sh | 4 ++-- tests-ng/link-import-default.sh | 4 ++-- tests-ng/link-templates-dir-home.sh | 6 +++--- tests-ng/link-templates-dir.sh | 6 +++--- tests-ng/link-templates.sh | 6 +++--- tests-ng/link-value-tests.sh | 4 ++-- tests-ng/profile-actions.sh | 6 +++--- tests-ng/profile-dynvariables.sh | 8 ++++---- tests-ng/recinclude.sh | 4 ++-- tests-ng/recvariables.sh | 4 ++-- tests-ng/remove.sh | 4 ++-- tests-ng/symlink.sh | 4 ++-- tests-ng/transformations.sh | 10 +++++----- tests-ng/update-ignore-relative.sh | 4 ++-- tests-ng/update-ignore.sh | 4 ++-- tests-ng/update-templates.sh | 6 +++--- tests-ng/update-with-key.sh | 4 ++-- tests-ng/update.sh | 4 ++-- tests-ng/variables-include.sh | 4 ++-- tests-ng/variables.sh | 4 ++-- tests-ng/workdir.sh | 12 ++++++------ 63 files changed, 153 insertions(+), 153 deletions(-) diff --git a/tests-ng/actions-args-template.sh b/tests-ng/actions-args-template.sh index 9a7df71..42dc3c7 100755 --- a/tests-ng/actions-args-template.sh +++ b/tests-ng/actions-args-template.sh @@ -60,12 +60,12 @@ should_grep() { } # the action temp -tmpa=`mktemp -d --suffix='-dotdrop-tests'` +tmpa=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # the dotfile source -tmps=`mktemp -d --suffix='-dotdrop-tests'` +tmps=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` mkdir -p ${tmps}/dotfiles # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/actions-args.sh b/tests-ng/actions-args.sh index b146141..6da4f43 100755 --- a/tests-ng/actions-args.sh +++ b/tests-ng/actions-args.sh @@ -46,12 +46,12 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename $BASH_SOURCE) <==$(tput sgr0)" ################################################################ # the action temp -tmpa=`mktemp -d --suffix='-dotdrop-tests'` +tmpa=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # the dotfile source -tmps=`mktemp -d --suffix='-dotdrop-tests'` +tmps=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` mkdir -p ${tmps}/dotfiles # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/actions-default.sh b/tests-ng/actions-default.sh index fc0acdb..5eb4572 100755 --- a/tests-ng/actions-default.sh +++ b/tests-ng/actions-default.sh @@ -46,12 +46,12 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename $BASH_SOURCE) <==$(tput sgr0)" ################################################################ # the action temp -tmpa=`mktemp -d --suffix='-dotdrop-tests'` +tmpa=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # the dotfile source -tmps=`mktemp -d --suffix='-dotdrop-tests'` +tmps=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` mkdir -p ${tmps}/dotfiles # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/actions-pre.sh b/tests-ng/actions-pre.sh index 7b1b2ee..48dc59a 100755 --- a/tests-ng/actions-pre.sh +++ b/tests-ng/actions-pre.sh @@ -46,12 +46,12 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename $BASH_SOURCE) <==$(tput sgr0)" ################################################################ # the action temp -tmpa=`mktemp -d --suffix='-dotdrop-tests'` +tmpa=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # the dotfile source -tmps=`mktemp -d --suffix='-dotdrop-tests'` +tmps=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` mkdir -p ${tmps}/dotfiles # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/actions-template.sh b/tests-ng/actions-template.sh index 3f1a0eb..36a8036 100755 --- a/tests-ng/actions-template.sh +++ b/tests-ng/actions-template.sh @@ -46,12 +46,12 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename $BASH_SOURCE) <==$(tput sgr0)" ################################################################ # the action temp -tmpa=`mktemp -d --suffix='-dotdrop-tests'` +tmpa=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # the dotfile source -tmps=`mktemp -d --suffix='-dotdrop-tests'` +tmps=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` mkdir -p ${tmps}/dotfiles # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/actions.sh b/tests-ng/actions.sh index b2f8f5e..3087ed7 100755 --- a/tests-ng/actions.sh +++ b/tests-ng/actions.sh @@ -46,12 +46,12 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename $BASH_SOURCE) <==$(tput sgr0)" ################################################################ # the action temp -tmpa=`mktemp -d --suffix='-dotdrop-tests'` +tmpa=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # the dotfile source -tmps=`mktemp -d --suffix='-dotdrop-tests'` +tmps=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` mkdir -p ${tmps}/dotfiles # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/compare-ignore-relative.sh b/tests-ng/compare-ignore-relative.sh index cb48f13..57c27a3 100755 --- a/tests-ng/compare-ignore-relative.sh +++ b/tests-ng/compare-ignore-relative.sh @@ -46,12 +46,12 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename $BASH_SOURCE) <==$(tput sgr0)" ################################################################ # dotdrop directory -basedir=`mktemp -d --suffix='-dotdrop-tests'` +basedir=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` echo "[+] dotdrop dir: ${basedir}" echo "[+] dotpath dir: ${basedir}/dotfiles" # the dotfile to be imported -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # some files mkdir -p ${tmpd}/{program,config,vscode} diff --git a/tests-ng/compare-ignore.sh b/tests-ng/compare-ignore.sh index dc67b75..98c986b 100755 --- a/tests-ng/compare-ignore.sh +++ b/tests-ng/compare-ignore.sh @@ -46,12 +46,12 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename $BASH_SOURCE) <==$(tput sgr0)" ################################################################ # dotdrop directory -basedir=`mktemp -d --suffix='-dotdrop-tests'` +basedir=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` echo "[+] dotdrop dir: ${basedir}" echo "[+] dotpath dir: ${basedir}/dotfiles" # the dotfile to be imported -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # some files mkdir -p ${tmpd}/{program,config} diff --git a/tests-ng/compare.sh b/tests-ng/compare.sh index e3d3f6e..7b8039e 100755 --- a/tests-ng/compare.sh +++ b/tests-ng/compare.sh @@ -46,12 +46,12 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename $BASH_SOURCE) <==$(tput sgr0)" ################################################################ # dotdrop directory -basedir=`mktemp -d --suffix='-dotdrop-tests'` +basedir=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` echo "[+] dotdrop dir: ${basedir}" echo "[+] dotpath dir: ${basedir}/dotfiles" # the dotfile to be imported -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # single file echo 'unique' > ${tmpd}/uniquefile diff --git a/tests-ng/deprecated-link.sh b/tests-ng/deprecated-link.sh index 1cf7e12..1085e91 100755 --- a/tests-ng/deprecated-link.sh +++ b/tests-ng/deprecated-link.sh @@ -46,10 +46,10 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/dir-import-update.sh b/tests-ng/dir-import-update.sh index 9cdcd1b..dfd0a3f 100755 --- a/tests-ng/dir-import-update.sh +++ b/tests-ng/dir-import-update.sh @@ -46,11 +46,11 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename $BASH_SOURCE) <==$(tput sgr0)" ################################################################ # dotdrop directory -basedir=`mktemp -d --suffix='-dotdrop-tests'` +basedir=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` dotfiles="${basedir}/dotfiles" echo "dotdrop dir: ${basedir}" # the dotfile -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` create_dir ${tmpd} # create the config file diff --git a/tests-ng/dotdrop-variables.sh b/tests-ng/dotdrop-variables.sh index c9032c9..f2a7fb8 100755 --- a/tests-ng/dotdrop-variables.sh +++ b/tests-ng/dotdrop-variables.sh @@ -46,11 +46,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 "dotfile source: ${tmps}" # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` #echo "dotfile destination: ${tmpd}" # create the config file diff --git a/tests-ng/dotfile-no-src.sh b/tests-ng/dotfile-no-src.sh index 3617cc1..4c6ecb1 100755 --- a/tests-ng/dotfile-no-src.sh +++ b/tests-ng/dotfile-no-src.sh @@ -47,11 +47,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 diff --git a/tests-ng/dotfile-sub-variables.sh b/tests-ng/dotfile-sub-variables.sh index d4408c4..d0d0ad2 100755 --- a/tests-ng/dotfile-sub-variables.sh +++ b/tests-ng/dotfile-sub-variables.sh @@ -46,10 +46,10 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/dotfile-variables.sh b/tests-ng/dotfile-variables.sh index 8bd2554..533a48e 100755 --- a/tests-ng/dotfile-variables.sh +++ b/tests-ng/dotfile-variables.sh @@ -46,10 +46,10 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/dotfiles-all.sh b/tests-ng/dotfiles-all.sh index 7d8a39d..8335994 100755 --- a/tests-ng/dotfiles-all.sh +++ b/tests-ng/dotfiles-all.sh @@ -47,11 +47,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 diff --git a/tests-ng/dotfiles-dyn-paths.sh b/tests-ng/dotfiles-dyn-paths.sh index d1c0f6d..542b92a 100755 --- a/tests-ng/dotfiles-dyn-paths.sh +++ b/tests-ng/dotfiles-dyn-paths.sh @@ -47,11 +47,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 diff --git a/tests-ng/duplicate-key.sh b/tests-ng/duplicate-key.sh index 2b85a34..2a34d36 100755 --- a/tests-ng/duplicate-key.sh +++ b/tests-ng/duplicate-key.sh @@ -46,10 +46,10 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/dynactions.sh b/tests-ng/dynactions.sh index 8fb1b1b..6c9f1fd 100755 --- a/tests-ng/dynactions.sh +++ b/tests-ng/dynactions.sh @@ -46,12 +46,12 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename $BASH_SOURCE) <==$(tput sgr0)" ################################################################ # the action temp -tmpa=`mktemp -d --suffix='-dotdrop-tests'` +tmpa=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # the dotfile source -tmps=`mktemp -d --suffix='-dotdrop-tests'` +tmps=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` mkdir -p ${tmps}/dotfiles # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/dyndotfilepaths.sh b/tests-ng/dyndotfilepaths.sh index c89ce73..f26c638 100755 --- a/tests-ng/dyndotfilepaths.sh +++ b/tests-ng/dyndotfilepaths.sh @@ -46,10 +46,10 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/dynextvariables.sh b/tests-ng/dynextvariables.sh index 2216c8c..05a843f 100755 --- a/tests-ng/dynextvariables.sh +++ b/tests-ng/dynextvariables.sh @@ -46,10 +46,10 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` #echo "dotfile destination: ${tmpd}" # create the config file diff --git a/tests-ng/dyninclude.sh b/tests-ng/dyninclude.sh index 300bd6e..34b500b 100755 --- a/tests-ng/dyninclude.sh +++ b/tests-ng/dyninclude.sh @@ -46,10 +46,10 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/dynvariables.sh b/tests-ng/dynvariables.sh index 9fd432a..8ab70e4 100755 --- a/tests-ng/dynvariables.sh +++ b/tests-ng/dynvariables.sh @@ -46,15 +46,15 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` #echo "dotfile destination: ${tmpd}" # create a shell script export TESTENV="this is my testenv" -scr=`mktemp --suffix='-dotdrop-tests'` +scr=`mktemp --suffix='-dotdrop-tests' || mktemp -d` chmod +x ${scr} echo -e "#!/bin/bash\necho $TESTENV\n" >> ${scr} diff --git a/tests-ng/ext-actions.sh b/tests-ng/ext-actions.sh index af35f06..f57ff17 100755 --- a/tests-ng/ext-actions.sh +++ b/tests-ng/ext-actions.sh @@ -46,12 +46,12 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename $BASH_SOURCE) <==$(tput sgr0)" ################################################################ # the action temp -tmpa=`mktemp -d --suffix='-dotdrop-tests'` +tmpa=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # the dotfile source -tmps=`mktemp -d --suffix='-dotdrop-tests'` +tmps=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` mkdir -p ${tmps}/dotfiles # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` act="${tmps}/actions.yaml" cat > ${act} << _EOF diff --git a/tests-ng/extvariables.sh b/tests-ng/extvariables.sh index 4283dd0..a7c07d1 100755 --- a/tests-ng/extvariables.sh +++ b/tests-ng/extvariables.sh @@ -46,10 +46,10 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` #echo "dotfile destination: ${tmpd}" # create the config file diff --git a/tests-ng/force-actions.sh b/tests-ng/force-actions.sh index b3245bf..c0342e8 100755 --- a/tests-ng/force-actions.sh +++ b/tests-ng/force-actions.sh @@ -46,12 +46,12 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename $BASH_SOURCE) <==$(tput sgr0)" ################################################################ # the action temp -tmpa=`mktemp -d --suffix='-dotdrop-tests'` +tmpa=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # the dotfile source -tmps=`mktemp -d --suffix='-dotdrop-tests'` +tmps=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` mkdir -p ${tmps}/dotfiles # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/global-compare-ignore.sh b/tests-ng/global-compare-ignore.sh index c77dc05..f3dde98 100755 --- a/tests-ng/global-compare-ignore.sh +++ b/tests-ng/global-compare-ignore.sh @@ -46,12 +46,12 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename $BASH_SOURCE) <==$(tput sgr0)" ################################################################ # dotdrop directory -basedir=`mktemp -d --suffix='-dotdrop-tests'` +basedir=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` echo "[+] dotdrop dir: ${basedir}" echo "[+] dotpath dir: ${basedir}/dotfiles" # the dotfile to be imported -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # some files mkdir -p ${tmpd}/{program,config} diff --git a/tests-ng/global-update-ignore.sh b/tests-ng/global-update-ignore.sh index df7372c..53285fb 100755 --- a/tests-ng/global-update-ignore.sh +++ b/tests-ng/global-update-ignore.sh @@ -46,7 +46,7 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename $BASH_SOURCE) <==$(tput sgr0)" ################################################################ # dotdrop directory -tmps=`mktemp -d --suffix='-dotdrop-tests'` +tmps=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` dt="${tmps}/dotfiles" mkdir -p ${dt} mkdir -p ${dt}/a/{b,c} @@ -54,7 +54,7 @@ echo 'a' > ${dt}/a/b/abfile echo 'a' > ${dt}/a/c/acfile # fs dotfiles -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` cp -r ${dt}/a ${tmpd}/ # create the config file diff --git a/tests-ng/globs.sh b/tests-ng/globs.sh index f32098c..6acbf18 100755 --- a/tests-ng/globs.sh +++ b/tests-ng/globs.sh @@ -49,12 +49,12 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # temporary -tmpa=`mktemp -d --suffix='-dotdrop-tests'` +tmpa=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` ########### # test globs in import_actions diff --git a/tests-ng/header.sh b/tests-ng/header.sh index cec3cfa..5c16ac3 100755 --- a/tests-ng/header.sh +++ b/tests-ng/header.sh @@ -46,11 +46,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 "dotfile source: ${tmps}" # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` #echo "dotfile destination: ${tmpd}" # create the config file diff --git a/tests-ng/ignore-empty.sh b/tests-ng/ignore-empty.sh index 1f9761b..fe8dbf1 100755 --- a/tests-ng/ignore-empty.sh +++ b/tests-ng/ignore-empty.sh @@ -46,11 +46,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 "dotfile source: ${tmps}" # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` #echo "dotfile destination: ${tmpd}" # create the config file diff --git a/tests-ng/import-configs.sh b/tests-ng/import-configs.sh index f9769be..a2c76e4 100755 --- a/tests-ng/import-configs.sh +++ b/tests-ng/import-configs.sh @@ -45,10 +45,10 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # create the config file cfg1="${tmps}/config1.yaml" diff --git a/tests-ng/import-duplicate.sh b/tests-ng/import-duplicate.sh index 0ad30ff..50cd1f2 100755 --- a/tests-ng/import-duplicate.sh +++ b/tests-ng/import-duplicate.sh @@ -45,10 +45,10 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` #echo "dotfile destination: ${tmpd}" # create the dotfile diff --git a/tests-ng/import-link-children.sh b/tests-ng/import-link-children.sh index f3ab979..88ae7e2 100755 --- a/tests-ng/import-link-children.sh +++ b/tests-ng/import-link-children.sh @@ -46,10 +46,10 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # dotpath dotpath="${tmps}/dotfiles" diff --git a/tests-ng/import-profile-dotfiles.sh b/tests-ng/import-profile-dotfiles.sh index a88d76e..ea565e2 100755 --- a/tests-ng/import-profile-dotfiles.sh +++ b/tests-ng/import-profile-dotfiles.sh @@ -46,10 +46,10 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` extdotfiles="${tmps}/df_p1.yaml" dynextdotfiles_name="d_uid_dynvar" diff --git a/tests-ng/import-subfile.sh b/tests-ng/import-subfile.sh index e6d8cce..141cf97 100755 --- a/tests-ng/import-subfile.sh +++ b/tests-ng/import-subfile.sh @@ -46,10 +46,10 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` #echo "dotfile destination: ${tmpd}" # create the dotfile diff --git a/tests-ng/import.sh b/tests-ng/import.sh index de233e9..c499ea7 100755 --- a/tests-ng/import.sh +++ b/tests-ng/import.sh @@ -45,10 +45,10 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` #echo "dotfile destination: ${tmpd}" # create the dotfile diff --git a/tests-ng/imported-configs-variables.sh b/tests-ng/imported-configs-variables.sh index 4f9ba9f..c6e0993 100755 --- a/tests-ng/imported-configs-variables.sh +++ b/tests-ng/imported-configs-variables.sh @@ -46,10 +46,10 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` #echo "dotfile destination: ${tmpd}" # create the config file diff --git a/tests-ng/include-actions.sh b/tests-ng/include-actions.sh index e476dc1..3f292c5 100755 --- a/tests-ng/include-actions.sh +++ b/tests-ng/include-actions.sh @@ -47,12 +47,12 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # the action temp -tmpa=`mktemp -d --suffix='-dotdrop-tests'` +tmpa=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/include-order.sh b/tests-ng/include-order.sh index 99cb96d..d903f59 100755 --- a/tests-ng/include-order.sh +++ b/tests-ng/include-order.sh @@ -47,12 +47,12 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # temporary -tmpa=`mktemp -d --suffix='-dotdrop-tests'` +tmpa=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/include.sh b/tests-ng/include.sh index fc1436a..a767d48 100755 --- a/tests-ng/include.sh +++ b/tests-ng/include.sh @@ -46,10 +46,10 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/inst-link-default.sh b/tests-ng/inst-link-default.sh index e9502c0..5ff2794 100755 --- a/tests-ng/inst-link-default.sh +++ b/tests-ng/inst-link-default.sh @@ -46,10 +46,10 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` #echo "dotfile destination: ${tmpd}" # create the dotfile diff --git a/tests-ng/jhelpers.sh b/tests-ng/jhelpers.sh index da266f9..ae72594 100755 --- a/tests-ng/jhelpers.sh +++ b/tests-ng/jhelpers.sh @@ -46,10 +46,10 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` #echo "dotfile destination: ${tmpd}" # create the config file diff --git a/tests-ng/link-import-default.sh b/tests-ng/link-import-default.sh index 1da8243..f46908a 100755 --- a/tests-ng/link-import-default.sh +++ b/tests-ng/link-import-default.sh @@ -46,10 +46,10 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/link-templates-dir-home.sh b/tests-ng/link-templates-dir-home.sh index 7c06330..1b7ed0e 100755 --- a/tests-ng/link-templates-dir-home.sh +++ b/tests-ng/link-templates-dir-home.sh @@ -46,14 +46,14 @@ 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 -p ${HOME} --suffix='-dotdrop-tests'` +tmpd=`mktemp -d -p ${HOME} --suffix='-dotdrop-tests' || mktemp -d` echo "dotfiles destination: ${tmpd}" # the workdir -tmpw=`mktemp -d -p ${HOME} --suffix='-dotdrop-tests'` +tmpw=`mktemp -d -p ${HOME} --suffix='-dotdrop-tests' || mktemp -d` echo "workdir: ${tmpw}" diff --git a/tests-ng/link-templates-dir.sh b/tests-ng/link-templates-dir.sh index f11c0f7..cf15d1a 100755 --- a/tests-ng/link-templates-dir.sh +++ b/tests-ng/link-templates-dir.sh @@ -46,14 +46,14 @@ 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}" # the workdir -tmpw=`mktemp -d --suffix='-dotdrop-tests'` +tmpw=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` echo "workdir: ${tmpw}" diff --git a/tests-ng/link-templates.sh b/tests-ng/link-templates.sh index d5aa87c..bea1e53 100755 --- a/tests-ng/link-templates.sh +++ b/tests-ng/link-templates.sh @@ -46,14 +46,14 @@ 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}" # the workdir -tmpw=`mktemp -d --suffix='-dotdrop-tests'` +tmpw=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` echo "workdir: ${tmpw}" diff --git a/tests-ng/link-value-tests.sh b/tests-ng/link-value-tests.sh index 1d3f938..61a86dd 100755 --- a/tests-ng/link-value-tests.sh +++ b/tests-ng/link-value-tests.sh @@ -47,10 +47,10 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/profile-actions.sh b/tests-ng/profile-actions.sh index ac781c8..2c5875d 100755 --- a/tests-ng/profile-actions.sh +++ b/tests-ng/profile-actions.sh @@ -46,13 +46,13 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` #echo "dotfile destination: ${tmpd}" # the action temp -tmpa=`mktemp -d --suffix='-dotdrop-tests'` +tmpa=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/profile-dynvariables.sh b/tests-ng/profile-dynvariables.sh index 6f32ce9..bdfb247 100755 --- a/tests-ng/profile-dynvariables.sh +++ b/tests-ng/profile-dynvariables.sh @@ -46,20 +46,20 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` #echo "dotfile destination: ${tmpd}" # create a shell script export TESTENV="this is my global testenv" -scr=`mktemp --suffix='-dotdrop-tests'` +scr=`mktemp --suffix='-dotdrop-tests' || mktemp -d` chmod +x ${scr} echo -e "#!/bin/bash\necho $TESTENV\n" >> ${scr} export TESTENV2="this is my profile testenv" -scr2=`mktemp --suffix='-dotdrop-tests'` +scr2=`mktemp --suffix='-dotdrop-tests' || mktemp -d` chmod +x ${scr2} echo -e "#!/bin/bash\necho $TESTENV2\n" >> ${scr2} diff --git a/tests-ng/recinclude.sh b/tests-ng/recinclude.sh index 43bcd75..cbef945 100755 --- a/tests-ng/recinclude.sh +++ b/tests-ng/recinclude.sh @@ -46,10 +46,10 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/recvariables.sh b/tests-ng/recvariables.sh index 74e8b14..47b9831 100755 --- a/tests-ng/recvariables.sh +++ b/tests-ng/recvariables.sh @@ -46,10 +46,10 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` #echo "dotfile destination: ${tmpd}" # create the config file diff --git a/tests-ng/remove.sh b/tests-ng/remove.sh index aaa31f2..c8f5c8b 100755 --- a/tests-ng/remove.sh +++ b/tests-ng/remove.sh @@ -46,10 +46,10 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename $BASH_SOURCE) <==$(tput sgr0)" ################################################################ # dotdrop directory -tmps=`mktemp -d --suffix='-dotdrop-tests'` +tmps=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` mkdir -p ${tmps}/dotfiles # the dotfile to be imported -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/symlink.sh b/tests-ng/symlink.sh index f9c46cb..4d88ce2 100755 --- a/tests-ng/symlink.sh +++ b/tests-ng/symlink.sh @@ -45,10 +45,10 @@ 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 # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` #echo "dotfile destination: ${tmpd}" ################################################## diff --git a/tests-ng/transformations.sh b/tests-ng/transformations.sh index 471383b..eae4e47 100755 --- a/tests-ng/transformations.sh +++ b/tests-ng/transformations.sh @@ -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 diff --git a/tests-ng/update-ignore-relative.sh b/tests-ng/update-ignore-relative.sh index 21fdbb9..ac9ef60 100755 --- a/tests-ng/update-ignore-relative.sh +++ b/tests-ng/update-ignore-relative.sh @@ -46,7 +46,7 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename $BASH_SOURCE) <==$(tput sgr0)" ################################################################ # dotdrop directory -tmps=`mktemp -d --suffix='-dotdrop-tests'` +tmps=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` dt="${tmps}/dotfiles" mkdir -p ${dt} mkdir -p ${dt}/a/{b,c} @@ -54,7 +54,7 @@ echo 'a' > ${dt}/a/b/abfile echo 'a' > ${dt}/a/c/acfile # fs dotfiles -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` cp -r ${dt}/a ${tmpd}/ # create the config file diff --git a/tests-ng/update-ignore.sh b/tests-ng/update-ignore.sh index 1751298..273482f 100755 --- a/tests-ng/update-ignore.sh +++ b/tests-ng/update-ignore.sh @@ -46,7 +46,7 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename $BASH_SOURCE) <==$(tput sgr0)" ################################################################ # dotdrop directory -tmps=`mktemp -d --suffix='-dotdrop-tests'` +tmps=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` dt="${tmps}/dotfiles" mkdir -p ${dt} mkdir -p ${dt}/a/{b,c} @@ -54,7 +54,7 @@ echo 'a' > ${dt}/a/b/abfile echo 'a' > ${dt}/a/c/acfile # fs dotfiles -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` cp -r ${dt}/a ${tmpd}/ # create the config file diff --git a/tests-ng/update-templates.sh b/tests-ng/update-templates.sh index 02a8fea..abdad4c 100755 --- a/tests-ng/update-templates.sh +++ b/tests-ng/update-templates.sh @@ -46,14 +46,14 @@ 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}" # the workdir -tmpw=`mktemp -d --suffix='-dotdrop-tests'` +tmpw=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` echo "workdir: ${tmpw}" diff --git a/tests-ng/update-with-key.sh b/tests-ng/update-with-key.sh index bdfa61b..47ba116 100755 --- a/tests-ng/update-with-key.sh +++ b/tests-ng/update-with-key.sh @@ -46,12 +46,12 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename $BASH_SOURCE) <==$(tput sgr0)" ################################################################ # dotdrop directory -basedir=`mktemp -d --suffix='-dotdrop-tests'` +basedir=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` echo "[+] dotdrop dir: ${basedir}" echo "[+] dotpath dir: ${basedir}/dotfiles" # the dotfile to be imported -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # originally imported directory echo 'unique' > ${tmpd}/uniquefile diff --git a/tests-ng/update.sh b/tests-ng/update.sh index b8bcaf6..83ca1d5 100755 --- a/tests-ng/update.sh +++ b/tests-ng/update.sh @@ -46,12 +46,12 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename $BASH_SOURCE) <==$(tput sgr0)" ################################################################ # dotdrop directory -basedir=`mktemp -d --suffix='-dotdrop-tests'` +basedir=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` echo "[+] dotdrop dir: ${basedir}" echo "[+] dotpath dir: ${basedir}/dotfiles" # the dotfile to be imported -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # single file echo 'unique' > ${tmpd}/uniquefile diff --git a/tests-ng/variables-include.sh b/tests-ng/variables-include.sh index 4647190..655fbb3 100755 --- a/tests-ng/variables-include.sh +++ b/tests-ng/variables-include.sh @@ -46,11 +46,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 "dotfile source: ${tmps}" # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` #echo "dotfile destination: ${tmpd}" # create the config file diff --git a/tests-ng/variables.sh b/tests-ng/variables.sh index 92f453e..b0ba712 100755 --- a/tests-ng/variables.sh +++ b/tests-ng/variables.sh @@ -46,11 +46,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 "dotfile source: ${tmps}" # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` #echo "dotfile destination: ${tmpd}" # create the config file diff --git a/tests-ng/workdir.sh b/tests-ng/workdir.sh index 9fd628c..1563921 100755 --- a/tests-ng/workdir.sh +++ b/tests-ng/workdir.sh @@ -47,7 +47,7 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename $BASH_SOURCE) <==$(tput sgr0)" string="blabla" # the dotfile source -tmp=`mktemp -d --suffix='-dotdrop-tests'` +tmp=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` tmpf="${tmp}/dotfiles" tmpw="${tmp}/workdir" @@ -62,7 +62,7 @@ cfg="${tmp}/config.yaml" echo "config file: ${cfg}" # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` echo "dotfiles destination: ${tmpd}" ## RELATIVE @@ -104,7 +104,7 @@ rm -rf ${tmp} ${tmpd} ## ABSOLUTE echo "RUNNING ABSOLUTE" # the dotfile source -tmp=`mktemp -d --suffix='-dotdrop-tests'` +tmp=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` tmpf="${tmp}/dotfiles" tmpw="${tmp}/workdir" @@ -119,7 +119,7 @@ cfg="${tmp}/config.yaml" echo "config file: ${cfg}" # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` echo "dotfiles destination: ${tmpd}" cat > ${cfg} << _EOF @@ -159,7 +159,7 @@ rm -rf ${tmp} ${tmpd} ## NONE echo "RUNNING UNDEFINED WORKDIR" # the dotfile source -tmp=`mktemp -d --suffix='-dotdrop-tests'` +tmp=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` tmpf="${tmp}/dotfiles" @@ -171,7 +171,7 @@ cfg="${tmp}/config.yaml" echo "config file: ${cfg}" # the dotfile destination -tmpd=`mktemp -d --suffix='-dotdrop-tests'` +tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` echo "dotfiles destination: ${tmpd}" cat > ${cfg} << _EOF