From 4a34c9493e849ed19a25e6d8de012e26ee911397 Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Sat, 2 Nov 2024 19:13:24 +0100 Subject: Create licenses directory if needed Also do some cleaning in the code. --- create-license.el | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/create-license.el b/create-license.el index a9a2e2c..f30e327 100644 --- a/create-license.el +++ b/create-license.el @@ -4,10 +4,8 @@ ;; Author: Tristan Riehs ;; Keywords: convenience license -;; Version: 1.0.0 ;; Maintainer: Tristan Riehs ;; URL: https://tristanriehs.fr/git/create-license -;; Package-Version: 1.0.1 ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -96,10 +94,14 @@ The destination file name under DIR is given by (list default-directory (let ((files (directory-files create-license-directory nil "^[^\\.].*"))) - (if files - (completing-read "License: " files nil 'require-match - nil 'create-license--hist (car create-license--hist)) - nil)))) + (when files + (completing-read "License: " + files + nil + 'require-match + nil + 'create-license--hist + (car create-license--hist)))))) (if name (progn @@ -115,6 +117,7 @@ The destination file name under DIR is given by "Download licenses listed in `create-license-common'." (interactive) (require 'url-handlers) + (make-directory create-license-directory t) (dolist (license create-license-common) (url-copy-file (cdr license) (expand-file-name (car license) create-license-directory)))) -- cgit v1.2.3