From 808b9607ec0d4bb45c120dd79293bae1499cb283 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Mon, 30 May 2022 09:50:00 +0200 Subject: [PATCH] testing --- tests-ng/dry.sh | 1 + tests-ng/link-templates-dir-home.sh | 1 + tests-ng/link-templates-dir.sh | 1 + tests-ng/link-templates.sh | 1 + tests-ng/symlink-relative.sh | 4 +++- tests-ng/update-templates.sh | 1 + tests-ng/workdir-compare.sh | 1 + tests-ng/workdir.sh | 2 ++ 8 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tests-ng/dry.sh b/tests-ng/dry.sh index 849ee08..1ae188d 100755 --- a/tests-ng/dry.sh +++ b/tests-ng/dry.sh @@ -52,6 +52,7 @@ tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` #echo "dotfile destination: ${tmpd}" # workdir tmpw=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` +export DOTDROP_WORKDIR="${tmpw}" # temp tmpa=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` diff --git a/tests-ng/link-templates-dir-home.sh b/tests-ng/link-templates-dir-home.sh index 3fd9569..b1bb603 100755 --- a/tests-ng/link-templates-dir-home.sh +++ b/tests-ng/link-templates-dir-home.sh @@ -55,6 +55,7 @@ tmpd=`mktemp -d -p ${HOME} --suffix='-dotdrop-tests' || mktemp -d` echo "dotfiles destination: ${tmpd}" # the workdir tmpw=`mktemp -d -p ${HOME} --suffix='-dotdrop-tests' || mktemp -d` +export DOTDROP_WORKDIR="${tmpw}" echo "workdir: ${tmpw}" clear_on_exit "${tmps}" diff --git a/tests-ng/link-templates-dir.sh b/tests-ng/link-templates-dir.sh index 2c0c74f..77b8d5a 100755 --- a/tests-ng/link-templates-dir.sh +++ b/tests-ng/link-templates-dir.sh @@ -55,6 +55,7 @@ tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` echo "dotfiles destination: ${tmpd}" # the workdir tmpw=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` +export DOTDROP_WORKDIR="${tmpw}" echo "workdir: ${tmpw}" clear_on_exit "${tmps}" diff --git a/tests-ng/link-templates.sh b/tests-ng/link-templates.sh index 68a60f9..8a74a45 100755 --- a/tests-ng/link-templates.sh +++ b/tests-ng/link-templates.sh @@ -55,6 +55,7 @@ tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` echo "dotfiles destination: ${tmpd}" # the workdir tmpw=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` +export DOTDROP_WORKDIR="${tmpw}" echo "workdir: ${tmpw}" clear_on_exit "${tmps}" diff --git a/tests-ng/symlink-relative.sh b/tests-ng/symlink-relative.sh index 7500d93..44bcd57 100755 --- a/tests-ng/symlink-relative.sh +++ b/tests-ng/symlink-relative.sh @@ -52,6 +52,7 @@ mkdir -p ${tmps}/dotfiles tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` #echo "dotfile destination: ${tmpd}" tmpw=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` +export DOTDROP_WORKDIR="${tmpw}" clear_on_exit "${tmps}" clear_on_exit "${tmpd}" @@ -132,7 +133,8 @@ grep 'file1' ${tmpd}/abc2 grep 'file2' ${tmpd}/def/afile grep 'This dotfile is managed using dotdrop' ${tmpd}/ghi grep 'This dotfile is managed using dotdrop' ${tmpd}/jkl/anotherfile -[[ $(realpath --relative-base="${tmpw}" -- "$(realpath ${tmpd}/ghi)") =~ ^/ ]] && echo "ghi not subpath of workdir" && exit 1 + +[[ $(realpath --relative-base="${tmpw}" -- "$(realpath ${tmpd}/ghi)") =~ "^/" ]] && echo "ghi not subpath of workdir" && exit 1 [[ $(realpath --relative-base="${tmpw}" -- "$(realpath ${tmpd}/jkl)") =~ ^/ ]] && echo "jkl not subpath of workdir" && exit 1 ## TODO test with install path children of dotpath diff --git a/tests-ng/update-templates.sh b/tests-ng/update-templates.sh index 7f56699..aaec60e 100755 --- a/tests-ng/update-templates.sh +++ b/tests-ng/update-templates.sh @@ -55,6 +55,7 @@ tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` echo "dotfiles destination: ${tmpd}" # the workdir tmpw=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` +export DOTDROP_WORKDIR="${tmpw}" echo "workdir: ${tmpw}" clear_on_exit "${tmps}" diff --git a/tests-ng/workdir-compare.sh b/tests-ng/workdir-compare.sh index e7371de..5251268 100755 --- a/tests-ng/workdir-compare.sh +++ b/tests-ng/workdir-compare.sh @@ -53,6 +53,7 @@ tmp=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` tmpf="${tmp}/dotfiles" tmpw="${tmp}/workdir" +export DOTDROP_WORKDIR="${tmpw}" mkdir -p ${tmpf} echo "dotfiles source (dotpath): ${tmpf}" diff --git a/tests-ng/workdir.sh b/tests-ng/workdir.sh index f7ca866..763bc04 100755 --- a/tests-ng/workdir.sh +++ b/tests-ng/workdir.sh @@ -53,6 +53,7 @@ tmp=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` tmpf="${tmp}/dotfiles" tmpw="${tmp}/workdir" +export DOTDROP_WORKDIR="${tmpw}" mkdir -p ${tmpf} echo "dotfiles source (dotpath): ${tmpf}" @@ -113,6 +114,7 @@ tmp=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` tmpf="${tmp}/dotfiles" tmpw="${tmp}/workdir" +export DOTDROP_WORKDIR="${tmpw}" mkdir -p ${tmpf} echo "dotfiles source (dotpath): ${tmpf}"