Support double-star globs in encrypt (#109)
This will only work for Bash >=4, there the shell option "globstar" is supported.
This commit is contained in:
parent
24e6e81713
commit
510169eb7f
1 changed files with 12 additions and 0 deletions
12
yadm
12
yadm
|
@ -1545,6 +1545,14 @@ function parse_encrypt() {
|
||||||
|
|
||||||
cd_work "Parsing encrypt" || return
|
cd_work "Parsing encrypt" || return
|
||||||
|
|
||||||
|
# setting globstar to allow ** in encrypt patterns
|
||||||
|
# (only supported on Bash >= 4)
|
||||||
|
local unset_globstar
|
||||||
|
if ! shopt globstar &>/dev/null; then
|
||||||
|
unset_globstar=1
|
||||||
|
fi
|
||||||
|
shopt -s globstar &>/dev/null
|
||||||
|
|
||||||
exclude_pattern="^!(.+)"
|
exclude_pattern="^!(.+)"
|
||||||
if [ -f "$YADM_ENCRYPT" ] ; then
|
if [ -f "$YADM_ENCRYPT" ] ; then
|
||||||
# parse both included/excluded
|
# parse both included/excluded
|
||||||
|
@ -1588,6 +1596,10 @@ function parse_encrypt() {
|
||||||
unset IFS
|
unset IFS
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$unset_globstar" = "1" ]; then
|
||||||
|
shopt -u globstar &>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function builtin_dirname() {
|
function builtin_dirname() {
|
||||||
|
|
Loading…
Reference in a new issue