aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaul Benencia <raul@thousandeyes.com>2024-11-12 15:34:37 -0800
committerRaul Benencia <raul@thousandeyes.com>2024-11-12 15:34:37 -0800
commitb25cc68585731c6e8295cfcd927518a4e0fa9682 (patch)
treefab1c7bd87ebf1c711298fc966a639fa6a40046e
parent932c1d4b146f48c8a576d25341e02293d0bbf9d7 (diff)
emacs: create backup dir if it doesn't exists
-rw-r--r--.emacs.d/init.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index c0fd0fa..acad923 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -6,9 +6,10 @@
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
-(if (file-directory-p "~/.backup")
- (setq backup-directory-alist '(("." . "~/.backup")))
- (message "Directory does not exist: ~/.backup"))
+(let ((backup-dir "~/.backup"))
+ (unless (file-directory-p backup-dir)
+ (make-directory backup-dir t))
+ (setq backup-directory-alist `(("." . ,backup-dir))))
(setq
backup-by-copying t ; Don't delink hardlinks
nihil fit ex nihilo