branch: elpa/emacsql
commit 497971121afcadbae6246fb842d1e6d22e3c05ad
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    emacsql-sqlite-dump-database: Override output file unless versioned
---
 emacsql-sqlite-common.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/emacsql-sqlite-common.el b/emacsql-sqlite-common.el
index 378df3e6d5..40c3662632 100644
--- a/emacsql-sqlite-common.el
+++ b/emacsql-sqlite-common.el
@@ -147,7 +147,7 @@ copied instead."
                          ".sql")))
     (cond
      ((locate-file "sqlite3" exec-path)
-      (when (file-exists-p output)
+      (when (and (file-exists-p output) versionp)
         (error "Cannot dump database; %s already exists" output))
       (with-temp-file output
         (message "Dumping %s database to %s..." name output)
@@ -164,7 +164,7 @@ copied instead."
      (versionp
       (setq output (concat (file-name-sans-extension output) ".db"))
       (message "Cannot dump database because sqlite3 binary cannot be found")
-      (when (file-exists-p output)
+      (when (and (file-exists-p output) versionp)
         (error "Cannot copy database; %s already exists" output))
       (message "Copying %s database to %s..." name output)
       (copy-file db output)

Reply via email to