Skip to content

Commit

Permalink
fix args
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Oct 1, 2023
1 parent cf6c9c9 commit 0626acc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions lisp/_prepare.el
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ Simply remove `--eask' for each option, like `--eask--strict' to `--strict'."
(eask-s-replace "--eask" "" arg))
eask-argv))

(defun eask-args ()
(defun eask-args (&optional index)
"Get all arguments except options."
(let ((argv (cl-remove-if (lambda (arg) (member arg eask--option-switches)) eask-argv))
(args) (skip-next))
Expand All @@ -850,7 +850,8 @@ Simply remove `--eask' for each option, like `--eask--strict' to `--strict'."
(if (member arg eask--option-args)
(setq skip-next t)
(push arg args))))
(reverse args)))
(setq args (reverse args))
(if index (nth 0 args) args)))

(defmacro eask--batch-mode (&rest body)
"Execute forms BODY in batch-mode."
Expand Down
2 changes: 1 addition & 1 deletion lisp/clean/dist.el
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
(- 3 deleted))))

(eask-start
(let* ((eask-dist-path (or (eask-argv 0) eask-dist-path))
(let* ((eask-dist-path (or (eask-args 0) eask-dist-path))
(eask-dist-path (expand-file-name eask-dist-path)))
(if (file-directory-p eask-dist-path)
(eask--clean-dist eask-dist-path)
Expand Down
2 changes: 1 addition & 1 deletion lisp/core/package.el
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Argument VERSION is a string represent the version number of this package."
(eask--packaged-file "el")))

(eask-start
(let* ((eask-dist-path (or (eask-argv 0) eask-dist-path))
(let* ((eask-dist-path (or (eask-args 0) eask-dist-path))
(eask-dist-path (expand-file-name eask-dist-path))
(packaged))
(ignore-errors (make-directory eask-dist-path t))
Expand Down
2 changes: 1 addition & 1 deletion lisp/generate/recipe.el
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
(eask-start
(if-let ((recipe (eask--recipe-string))
(name (eask-guess-package-name)))
(let* ((eask-recipe-path (or (eask-argv 0) eask-recipe-path))
(let* ((eask-recipe-path (or (eask-args 0) eask-recipe-path))
(eask-recipe-path (expand-file-name eask-recipe-path))
(recipe-file (expand-file-name name eask-recipe-path))
(recipe-string (pp-to-string recipe)))
Expand Down

0 comments on commit 0626acc

Please sign in to comment.