Skip to content

Commit 32a5575

Browse files
authored
fix: Command check flag (#321)
1 parent 8f383f8 commit 32a5575

File tree

7 files changed

+24
-15
lines changed

7 files changed

+24
-15
lines changed

docs/content/Development-API/_index.en.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,7 @@ then,
134134
Report error if the current command requires minimum `version`.
135135

136136
```elisp
137-
(eask-start
138-
(eask-command-check "27.1") ; The command requires 27.1 and above!
139-
...
137+
(eask-command-check "27.1") ; The command requires 27.1 and above!
140138
```
141139

142140
## 🔍 Function: eask-command-p (`commands`)

docs/content/Development-API/_index.zh-tw.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,7 @@ eask init
133133
如果目前的指令需要最低的 `version` 就會報錯。
134134

135135
```elisp
136-
(eask-start
137-
(eask-command-check "27.1") ; 此指令需要 27.1 及以上版本!
138-
...
136+
(eask-command-check "27.1") ; 此指令需要 27.1 及以上版本!
139137
```
140138

141139
## 🔍 函式: eask-command-p (`commands`)

lisp/_prepare.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ will return `lint/checkdoc' with a dash between two subcommands."
164164
"Report error if the current command requires minimum VERSION."
165165
(when (version< emacs-version version)
166166
(eask-error "The command `%s' requires Emacs %s and above!"
167-
(eask-command) version)))
167+
(eask-s-replace "/" " " (eask-command)) ; Pretty print.
168+
version)))
168169

169170
(defun eask-command-p (commands)
170171
"Return t if COMMANDS is the current command."

lisp/core/install-vc.el

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@
2222

2323
(eask-load "core/install")
2424

25+
;;
26+
;;; Flags
27+
28+
(eask-command-check "29.1")
29+
30+
;;
31+
;;; Core
32+
2533
(defun eask-install-vc--guess-name (file)
2634
"Guess the package name of the install FILE."
2735
(file-name-sans-extension (file-name-nondirectory (directory-file-name file))))
@@ -63,8 +71,6 @@
6371
installed s skipped)))
6472

6573
(eask-start
66-
(eask-command-check "29.1")
67-
6874
(eask-pkg-init)
6975
(if-let* ((specs (eask-args)))
7076
;; If package [specs..] are specified, we try to install it

lisp/core/loc.el

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@
1919
(locate-dominating-file dir "_prepare.el"))
2020
nil t))
2121

22+
;;
23+
;;; Flags
24+
25+
(eask-command-check "28.1")
26+
27+
;;
28+
;;; Core
29+
2230
(defvar eask-loc--lines 0)
2331
(defvar eask-loc--chars 0)
2432

@@ -35,8 +43,6 @@
3543
(insert (format "| %s | %s | %s |\n" file lines chars)))))
3644

3745
(eask-start
38-
(eask-command-check "28.1")
39-
4046
;; Preparation
4147
(eask-archive-install-packages '("gnu" "melpa")
4248
'markdown-mode)

lisp/format/elisp-autofmt.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
;;
2828
;;; Flags
2929

30+
(eask-command-check "29.1")
31+
3032
(advice-add #'eask-allow-error-p :override #'always)
3133

3234
;;
@@ -45,8 +47,6 @@
4547
(kill-buffer))))
4648

4749
(eask-start
48-
(eask-command-check "29.1")
49-
5050
;; Preparation
5151
(eask-archive-install-packages '("gnu" "melpa")
5252
'elisp-autofmt)

lisp/lint/regexps.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
;;
2828
;;; Flags
2929

30+
(eask-command-check "27.1")
31+
3032
(advice-add #'eask-allow-error-p :override #'always)
3133

3234
;;
@@ -59,8 +61,6 @@
5961
(kill-this-buffer))))
6062

6163
(eask-start
62-
(eask-command-check "27.1")
63-
6464
;; Preparation
6565
(eask-archive-install-packages '("gnu")
6666
'relint)

0 commit comments

Comments
 (0)