diff options
-rw-r--r-- | create-license.el | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/create-license.el b/create-license.el index 92a6f5f..4ee7618 100644 --- a/create-license.el +++ b/create-license.el @@ -54,13 +54,20 @@ dot." The destination file name under DIR is given by `create-license-file-name'." - (interactive (list - default-directory - (completing-read - "License: " - (directory-files create-license-directory nil "^[^\\.].*")))) - (copy-file (expand-file-name name create-license-directory) - (expand-file-name create-license-file-name dir))) + (interactive + (list + default-directory + (let ((files (directory-files create-license-directory nil "^[^\\.].*"))) + (if files + (completing-read "License: " files nil 'require-match) + nil)))) + + (if name + (copy-file (expand-file-name name create-license-directory) + (expand-file-name create-license-file-name dir)) + (message "No license found in \"%s\", you may want to run \ +`create-license-download-common'" + create-license-directory))) (defcustom create-license-common '(("GPL3" . "https://www.gnu.org/licenses/gpl-3.0.txt") |