mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-10 01:44:16 +00:00
test for failing pre-action
This commit is contained in:
@@ -59,6 +59,7 @@ cfg="${tmps}/config.yaml"
|
|||||||
cat > ${cfg} << _EOF
|
cat > ${cfg} << _EOF
|
||||||
actions:
|
actions:
|
||||||
pre:
|
pre:
|
||||||
|
failpre: "false"
|
||||||
preaction: echo 'pre' > ${tmpa}/pre
|
preaction: echo 'pre' > ${tmpa}/pre
|
||||||
preaction2: echo 'pre2' > ${tmpa}/pre2
|
preaction2: echo 'pre2' > ${tmpa}/pre2
|
||||||
preaction3: echo 'pre3' > ${tmpa}/pre3
|
preaction3: echo 'pre3' > ${tmpa}/pre3
|
||||||
@@ -78,6 +79,11 @@ dotfiles:
|
|||||||
actions:
|
actions:
|
||||||
- preaction
|
- preaction
|
||||||
- nakedaction
|
- nakedaction
|
||||||
|
f_fail:
|
||||||
|
dst: ${tmpd}/fail
|
||||||
|
src: fail
|
||||||
|
actions:
|
||||||
|
- failpre
|
||||||
f_link:
|
f_link:
|
||||||
dst: ${tmpd}/link
|
dst: ${tmpd}/link
|
||||||
src: link
|
src: link
|
||||||
@@ -105,12 +111,16 @@ profiles:
|
|||||||
- f_link
|
- f_link
|
||||||
- d_dir
|
- d_dir
|
||||||
- d_dlink
|
- d_dlink
|
||||||
|
p2:
|
||||||
|
dotfiles:
|
||||||
|
- f_fail
|
||||||
_EOF
|
_EOF
|
||||||
#cat ${cfg}
|
#cat ${cfg}
|
||||||
|
|
||||||
# create the dotfile
|
# create the dotfile
|
||||||
echo 'test' > ${tmps}/dotfiles/abc
|
echo 'test' > ${tmps}/dotfiles/abc
|
||||||
echo 'link' > ${tmps}/dotfiles/link
|
echo 'link' > ${tmps}/dotfiles/link
|
||||||
|
echo 'fail' > ${tmps}/dotfiles/fail
|
||||||
|
|
||||||
mkdir -p ${tmps}/dotfiles/dir
|
mkdir -p ${tmps}/dotfiles/dir
|
||||||
echo 'test1' > ${tmps}/dotfiles/dir/file1
|
echo 'test1' > ${tmps}/dotfiles/dir/file1
|
||||||
@@ -151,6 +161,13 @@ rm ${tmpa}/pre
|
|||||||
cd ${ddpath} | ${bin} install -f -c ${cfg} -p p1
|
cd ${ddpath} | ${bin} install -f -c ${cfg} -p p1
|
||||||
[ -e ${tmpa}/pre ] && exit 1
|
[ -e ${tmpa}/pre ] && exit 1
|
||||||
|
|
||||||
|
# ensure failing actions make the installation fail
|
||||||
|
# install
|
||||||
|
set +e
|
||||||
|
cd ${ddpath} | ${bin} install -f -c ${cfg} -p p2 -V
|
||||||
|
set -e
|
||||||
|
[ -e ${tmpd}/fail ] && exit 1
|
||||||
|
|
||||||
## CLEANING
|
## CLEANING
|
||||||
rm -rf ${tmps} ${tmpd} ${tmpa}
|
rm -rf ${tmps} ${tmpd} ${tmpa}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user