aboutsummaryrefslogtreecommitdiff
path: root/create-license.el
diff options
context:
space:
mode:
authorTristan Riehs <tristan.riehs@bordeaux-inp.fr>2024-11-02 19:13:24 +0100
committerTristan Riehs <tristan.riehs@bordeaux-inp.fr>2024-11-02 19:13:24 +0100
commit4a34c9493e849ed19a25e6d8de012e26ee911397 (patch)
treef0880a6d6c70d18b5bd9b053b5d90938323f3285 /create-license.el
parenta749834042b2651052023b58774a7869475303ed (diff)
Create licenses directory if neededv1.0.2
Also do some cleaning in the code.
Diffstat (limited to 'create-license.el')
-rw-r--r--create-license.el15
1 files 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 <tristan.riehs@bordeaux-inp.fr>
;; Keywords: convenience license
-;; Version: 1.0.0
;; Maintainer: Tristan Riehs <tristan.riehs@bordeaux-inp.fr>
;; 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))))