summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xalpine-to-carddav16
1 files changed, 8 insertions, 8 deletions
diff --git a/alpine-to-carddav b/alpine-to-carddav
index c9338fb..0766f35 100755
--- a/alpine-to-carddav
+++ b/alpine-to-carddav
@@ -67,7 +67,7 @@ git -C "${git_dir}" diff -U0 -- addressbook \
removals=false
;;
'+'*)
- last_uid="${last_uids[${#last_uids[@]}]}"
+ newUID="${last_uids[${#last_uids[@]}]}"
mapfile -t last_uids < <(
printf '%s\n' "${last_uids[@]}" \
| sed '$d'
@@ -79,26 +79,26 @@ git -C "${git_dir}" diff -U0 -- addressbook \
date -u -Iseconds \
| sed 's@+00:00$@Z@'
)
- if [ -z "${last_uid}" ]; then
+ if [ -z "${newUID}" ]; then
if ${removals}; then
>&2 printf 'There were more addresses added than removed.\n'
exit 1
fi
- last_uid=$(uuidgen)
- printf '%s\t%s\n' "${last_uid}" "${line#+}" \
+ newUID=$(uuidgen)
+ printf '%s\t%s\n' "${newUID}" "${line#+}" \
>> "${git_dir}/uids"
- print_cnt 'new' > "${git_dir}/${last_uid}.vcs"
+ print_cnt 'new' > "${git_dir}/${newUID}.vcs"
else
read_line 'old' < <(
sed '
- s/^'"${last_uid}"'\t//
+ s/^'"${newUID}"'\t//
t
d
' "${git_dir}/uids"
)
sed -i '
- /^'"${last_uid}"'\t/ {
- i '"${last_uid}$(printf '\t')${line#+}"'
+ /^'"${newUID}"'\t/ {
+ i '"${newUID}$(printf '\t')${line#+}"'
d
}
' "${git_dir}/uids"