1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-06 04:23:01 +00:00

Fixing :optional import attribute for globbed paths

This commit is contained in:
Davide Laezza
2020-03-21 14:52:41 +01:00
parent 736941a147
commit 17cc6bd33a
2 changed files with 190 additions and 58 deletions

View File

@@ -65,12 +65,15 @@ config:
import_variables:
- /variables/does/not/exist:optional
- /variables/does/not/::exist:optional
- /variables/*/not/exist:optional
import_actions:
- /actions/does/not/exist:optional
- /actions/does/not/::exist:optional
- /actions/does/*/exist:optional
import_configs:
- /configs/does/not/exist:optional
- /configs/does/not/::exist:optional
- /configs/does/not/*:optional
dotfiles:
f_abc:
dst: ${tmpd}/abc
@@ -108,6 +111,29 @@ cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
[ "$?" = "0" ] && echo "variables" && exit 1
set -e
cat > ${cfg} << _EOF
config:
backup: true
create: true
dotpath: dotfiles
import_variables:
- /variables/*/not/exist
dotfiles:
f_abc:
dst: ${tmpd}/abc
src: abc
profiles:
p1:
dotfiles:
- f_abc
_EOF
# dummy call
set +e
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
[ "$?" = "0" ] && echo "variables glob" && exit 1
set -e
cat > ${cfg} << _EOF
config:
backup: true
@@ -131,6 +157,29 @@ cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
[ "$?" = "0" ] && echo "actions" && exit 1
set -e
cat > ${cfg} << _EOF
config:
backup: true
create: true
dotpath: dotfiles
import_actions:
- /actions/does/*/exist
dotfiles:
f_abc:
dst: ${tmpd}/abc
src: abc
profiles:
p1:
dotfiles:
- f_abc
_EOF
# dummy call
set +e
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
[ "$?" = "0" ] && echo "actions glob" && exit 1
set -e
cat > ${cfg} << _EOF
config:
backup: true
@@ -154,6 +203,29 @@ cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
[ "$?" = "0" ] && echo "configs" && exit 1
set -e
cat > ${cfg} << _EOF
config:
backup: true
create: true
dotpath: dotfiles
import_configs:
- /configs/does/not/*
dotfiles:
f_abc:
dst: ${tmpd}/abc
src: abc
profiles:
p1:
dotfiles:
- f_abc
_EOF
# dummy call
set +e
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
[ "$?" = "0" ] && echo "configs glob" && exit 1
set -e
## CLEANING
rm -rf ${tmps} ${tmpd}