1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-08 19:34:17 +00:00

add func_file and filter_file for the config (for #210)

This commit is contained in:
deadc0de6
2020-02-15 13:05:17 +01:00
parent b56e8ea00b
commit fb071321e9
3 changed files with 29 additions and 11 deletions

View File

@@ -77,6 +77,8 @@ profiles:
p1:
dotfiles:
- f_abc
variables:
filt: "{{@@ 'whatever' | filter1 @@}}"
_EOF
#cat ${cfg}
@@ -116,6 +118,7 @@ echo "{{@@ "abc" | filter1 @@}}" >> ${tmps}/dotfiles/abc
echo "{{@@ "arg1" | filter2('arg2') @@}}" >> ${tmps}/dotfiles/abc
echo "{{@@ "13" | filter3() @@}}" >> ${tmps}/dotfiles/abc
echo "{{@@ "something" | filter_ext() @@}}" >> ${tmps}/dotfiles/abc
echo "{{@@ filt @@}}variable" >> ${tmps}/dotfiles/abc
# install
cd ${ddpath} | ${bin} install -f -c ${cfg} -p p1 -V
@@ -129,6 +132,7 @@ grep '^external$' ${tmpd}/abc >/dev/null
set +e
grep '^something$' ${tmpd}/abc >/dev/null && exit 1
set -e
grep '^filteredvariable$' ${tmpd}/abc > /dev/null
## CLEANING
rm -rf ${tmps} ${tmpd} ${filter_file} ${filter_file2} ${filter_file3}

View File

@@ -77,6 +77,8 @@ profiles:
p1:
dotfiles:
- f_abc
variables:
func: "{{@@ func1(False) @@}}"
_EOF
#cat ${cfg}
@@ -132,6 +134,8 @@ echo "{%@@ if func3("whatever") == 42 @@%}" >> ${tmps}/dotfiles/abc
echo "externalok" >> ${tmps}/dotfiles/abc
echo "{%@@ endif @@%}" >> ${tmps}/dotfiles/abc
echo "{{@@ func @@}}added" >> ${tmps}/dotfiles/abc
# install
cd ${ddpath} | ${bin} install -f -c ${cfg} -p p1 -V
@@ -144,6 +148,7 @@ grep '^externalok$' ${tmpd}/abc >/dev/null
set +e
grep '^nope$' ${tmpd}/abc >/dev/null && exit 1
set -e
grep '^Falseadded$' ${tmpd}/abc >/dev/null
## CLEANING
rm -rf ${tmps} ${tmpd} ${func_file} ${func_file2} ${func_file3}