Merge pull request #81 from japm48/patch-1
Add support for directories in .yadm/encrypt
This commit is contained in:
commit
abf6cd1c4c
1 changed files with 4 additions and 4 deletions
8
yadm
8
yadm
|
@ -178,7 +178,7 @@ function alt() {
|
|||
if [[ ! $glob =~ ^# && ! $glob =~ ^[[:space:]]*$ ]] ; then
|
||||
# echo "working on ->$glob<-"
|
||||
local IFS=$'\n'
|
||||
for matching_file in $(eval "$LS_PROGRAM" "$glob" 2>/dev/null); do
|
||||
for matching_file in $(eval "$LS_PROGRAM" -d "$glob" 2>/dev/null); do
|
||||
ENC_FILES[$index]="$matching_file"
|
||||
((index++))
|
||||
done
|
||||
|
@ -460,7 +460,7 @@ function encrypt() {
|
|||
while IFS='' read -r glob || [ -n "$glob" ]; do
|
||||
if [[ ! $glob =~ ^# && ! $glob =~ ^[[:space:]]*$ ]] ; then
|
||||
local IFS=$'\n'
|
||||
for matching_file in $(eval "$LS_PROGRAM" "$glob" 2>/dev/null); do
|
||||
for matching_file in $(eval "$LS_PROGRAM" -d "$glob" 2>/dev/null); do
|
||||
ENC_FILES[$index]="$matching_file"
|
||||
((index++))
|
||||
done
|
||||
|
@ -469,7 +469,7 @@ function encrypt() {
|
|||
|
||||
#; report which files will be encrypted
|
||||
echo "Encrypting the following files:"
|
||||
"$LS_PROGRAM" -1 "${ENC_FILES[@]}"
|
||||
"$LS_PROGRAM" -1 -d "${ENC_FILES[@]}"
|
||||
echo
|
||||
|
||||
#; encrypt all files which match the globs
|
||||
|
@ -711,7 +711,7 @@ function perms() {
|
|||
if [ -f "$YADM_ENCRYPT" ] ; then
|
||||
while IFS='' read -r glob || [ -n "$glob" ]; do
|
||||
if [[ ! $glob =~ ^# ]] ; then
|
||||
GLOBS=("${GLOBS[@]}" $(eval "$LS_PROGRAM" "$glob" 2>/dev/null))
|
||||
GLOBS=("${GLOBS[@]}" $(eval "$LS_PROGRAM" -d "$glob" 2>/dev/null))
|
||||
fi
|
||||
done < "$YADM_ENCRYPT"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue