org-persist-write: Overwrite existing copy if write is requested

This commit is contained in:
Ihor Radchenko 2022-01-26 10:11:31 +08:00
parent 0e18c617cf
commit 6a5874bb26
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 2 additions and 4 deletions

View File

@ -634,8 +634,7 @@ COLLECTION is the plist holding data collectin."
(format "%s-%s.%s" persist-file (md5 path) ext))))
(unless (file-exists-p (file-name-directory file-copy))
(make-directory (file-name-directory file-copy) t))
(unless (file-exists-p file-copy)
(copy-file path file-copy 'overwrite))
(copy-file path file-copy 'overwrite)
(format "%s-%s.%s" persist-file (md5 path) ext)))))
(defun org-persist-write:url (c collection)
@ -650,8 +649,7 @@ COLLECTION is the plist holding data collectin."
(format "%s-%s.%s" persist-file (md5 path) ext))))
(unless (file-exists-p (file-name-directory file-copy))
(make-directory (file-name-directory file-copy) t))
(unless (file-exists-p file-copy)
(url-copy-file path file-copy 'overwrite))
(url-copy-file path file-copy 'overwrite)
(format "%s-%s.%s" persist-file (md5 path) ext)))))
(defun org-persist-write:index (container _)