Преглед изворни кода

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

Ihor Radchenko пре 3 година
родитељ
комит
6a5874bb26
1 измењених фајлова са 2 додато и 4 уклоњено
  1. 2 4
      lisp/org-persist.el

+ 2 - 4
lisp/org-persist.el

@@ -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 _)