mirror of
https://github.com/TheLocehiliosan/yadm
synced 2025-06-13 13:03:58 +00:00
Have yadm encrypt
match dotfiles (like .gitignore does)
This commit is contained in:
parent
09a018ea5a
commit
5bb192a869
5
yadm
5
yadm
@ -921,6 +921,9 @@ function parse_encrypt() {
|
|||||||
|
|
||||||
exclude_pattern="^!(.+)"
|
exclude_pattern="^!(.+)"
|
||||||
if [ -f "$YADM_ENCRYPT" ] ; then
|
if [ -f "$YADM_ENCRYPT" ] ; then
|
||||||
|
shopt_dotglob="$(shopt -p dotglob)"
|
||||||
|
shopt -s dotglob
|
||||||
|
|
||||||
#; parse both included/excluded
|
#; parse both included/excluded
|
||||||
while IFS='' read -r line || [ -n "$line" ]; do
|
while IFS='' read -r line || [ -n "$line" ]; do
|
||||||
if [[ ! $line =~ ^# && ! $line =~ ^[[:space:]]*$ ]] ; then
|
if [[ ! $line =~ ^# && ! $line =~ ^[[:space:]]*$ ]] ; then
|
||||||
@ -943,6 +946,8 @@ function parse_encrypt() {
|
|||||||
fi
|
fi
|
||||||
done < "$YADM_ENCRYPT"
|
done < "$YADM_ENCRYPT"
|
||||||
|
|
||||||
|
eval "$shopt_dotglob"
|
||||||
|
|
||||||
#; remove excludes from the includes
|
#; remove excludes from the includes
|
||||||
#(SC2068 is disabled because in this case, we desire globbing)
|
#(SC2068 is disabled because in this case, we desire globbing)
|
||||||
FINAL_INCLUDE=()
|
FINAL_INCLUDE=()
|
||||||
|
Loading…
Reference in New Issue
Block a user