Skip to content

Commit

Permalink
Fix renaming files explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsius committed Sep 6, 2024
1 parent 5973156 commit d5661f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions package-build.el
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,9 @@ FILES is a list of (SOURCE . DEST) relative filepath pairs."
((and `(:inputs . ,globs)
(guard (cl-every #'stringp globs)))
(mapcan #'toargs globs))
((and `(:rename ,src ,dest)
(guard (and (stringp src) (stringp dest))))
(toargs src))
((and `(,dir . ,globs)
(guard (stringp dir))
(guard (cl-every #'stringp globs)))
Expand Down
7 changes: 4 additions & 3 deletions package-recipe.el
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,15 @@ file is invalid, then raise an error."
(when (eq (car spec) :defaults)
(setq spec (cdr spec)))
;; All other elements have to be strings or lists of strings.
;; Lists whose first element is `:exclude' or `:inputs' are
;; also valid.
;; Lists whose first element is `:exclude', `:inputs' or
;; `:rename' are also valid.
(dolist (entry spec)
(unless (cond ((stringp entry)
(not (equal entry "*")))
((listp entry)
(and-let* ((globs (cdr entry)))
(and (or (memq (car entry) '(:exclude :inputs))
(and (or (memq (car entry)
'(:exclude :inputs :rename))
(stringp (car entry)))
(seq-every-p (lambda (glob)
(and (stringp glob)
Expand Down

0 comments on commit d5661f1

Please sign in to comment.