diff options
author | Erich Eckner <git@eckner.net> | 2021-11-13 22:05:32 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2021-11-13 22:05:32 +0100 |
commit | 99ddecacdbccd32dae5f99e2269eea9415026b6a (patch) | |
tree | e8620d1bd4c47b3669ed2eb4c3a5b0a39f1fc1ae /alpine-to-carddav | |
parent | d3a28c07ba52c517a44cb5d34089bf7d05d7b190 (diff) | |
download | carddav-alpine-converter-99ddecacdbccd32dae5f99e2269eea9415026b6a.tar.xz |
vcs -> vcf
Diffstat (limited to 'alpine-to-carddav')
-rwxr-xr-x | alpine-to-carddav | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/alpine-to-carddav b/alpine-to-carddav index 0766f35..5d2938f 100755 --- a/alpine-to-carddav +++ b/alpine-to-carddav @@ -6,7 +6,7 @@ if [ -z "$(git -C "${git_dir}" diff)" ]; then exit fi -find_vcs \ +find_vcfs \ | while read -r file; do if [ ! -f "${file}" ]; then >&2 printf 'File "%s" is in git, but not in the worktree.\n' "${file##*/}" @@ -61,7 +61,7 @@ git -C "${git_dir}" diff -U0 -- addressbook \ '@@ '*) for last_uid in "${last_uids[@]}"; do sed -i '/^'"${last_uid}"'\s/d' "${git_dir}/uids" - rm "${git_dir}/${last_uid}.vcs" + rm "${git_dir}/${last_uid}.vcf" done last_uids=() removals=false @@ -87,7 +87,7 @@ git -C "${git_dir}" diff -U0 -- addressbook \ newUID=$(uuidgen) printf '%s\t%s\n' "${newUID}" "${line#+}" \ >> "${git_dir}/uids" - print_cnt 'new' > "${git_dir}/${newUID}.vcs" + print_cnt 'new' > "${git_dir}/${newUID}.vcf" else read_line 'old' < <( sed ' @@ -106,10 +106,10 @@ git -C "${git_dir}" diff -U0 -- addressbook \ if eval '[ "${old'"${key}"'}" != "${new'"${key}"'}" ]'; then for insert in "${key}:" 'VERSION:' 'BEGIN:VCARD$' ''; do if [ -z "${insert}" ]; then - >&2 printf 'Cannot find any place to insert into "%s".\n' "${uid}.vcs" + >&2 printf 'Cannot find any place to insert into "%s".\n' "${uid}.vcf" exit 1 fi - if ! grep -q '^'"${insert}" "${git_dir}/${uid}.vcs"; then + if ! grep -q '^'"${insert}" "${git_dir}/${uid}.vcf"; then continue fi if [ "${insert}" = "${key}:" ]; then @@ -128,7 +128,7 @@ git -C "${git_dir}" diff -U0 -- addressbook \ '"${insert_command}"' '"${delete_command}"' } - ' "${git_dir}/${uid}.vcs" + ' "${git_dir}/${uid}.vcf" break done fi |