From fcd2f13077178ccc89fc4af5a0f514687e508108 Mon Sep 17 00:00:00 2001 From: Sibi Prabakaran Date: Thu, 22 Dec 2022 21:43:40 +0530 Subject: [PATCH 1/3] Ability to execute default recipe --- README.org | 2 ++ justl.el | 7 +++++++ test/justl-test.el | 9 +++++++++ 3 files changed, 18 insertions(+) diff --git a/README.org b/README.org index a983310..33bb512 100644 --- a/README.org +++ b/README.org @@ -57,6 +57,8 @@ Alternatively if you want to just execute a recipe quickly, call M-x justl-exec-recipe-in-dir #+end_example +To execute default recipe, call *justl-exec-default-recipe* + * Shortcuts On the just screen, place your cursor on a recipe: diff --git a/justl.el b/justl.el index a7acc37..ee2beba 100644 --- a/justl.el +++ b/justl.el @@ -41,6 +41,8 @@ ;; ;; M-x justl-exec-recipe-in-dir ;; +;; To execute default recipe, call justl-exec-default-recipe +;; ;; Shortcuts: ;; ;; On the just screen, place your cursor on a recipe @@ -506,6 +508,11 @@ and output of process." nil nil nil nil "default"))) (justl--exec-without-justfile justl-executable (list recipies)))) +(defun justl-exec-default-recipe () + "Execute default recipe." + (interactive) + (justl--exec-without-justfile justl-executable (list "default"))) + (defvar justl-mode-map (let ((map (make-sparse-keymap))) (define-key map (kbd "g") 'justl--refresh-buffer) diff --git a/test/justl-test.el b/test/justl-test.el index d8e20c9..abb4098 100644 --- a/test/justl-test.el +++ b/test/justl-test.el @@ -239,6 +239,15 @@ (kill-buffer (justl--buffer-name)) (kill-buffer justl--output-process-buffer)) +(ert-deftest justl--execute-default-recipe () + "Checks that default recipe is printed." + (justl-exec-default-recipe) + (justl--wait-till-exit justl--output-process-buffer) + (with-current-buffer justl--output-process-buffer + (let ((buf-string (buffer-substring-no-properties (point-min) (point-max)))) + (should (s-contains? "Available recipes:\n" buf-string)))) + (kill-buffer justl--output-process-buffer)) + ;; (ert "justl--**") (provide 'justl-test) From afbc63061706fa4dc65be2a4f2810900275344f4 Mon Sep 17 00:00:00 2001 From: Sibi Prabakaran Date: Thu, 22 Dec 2022 22:00:59 +0530 Subject: [PATCH 2/3] Do not harcode it to default name as the first recipe is the default --- justl.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/justl.el b/justl.el index ee2beba..a7ef0c6 100644 --- a/justl.el +++ b/justl.el @@ -474,7 +474,8 @@ and output of process." (defun justl--justfile-from-arg (arg) "Return justfile filepath from ARG." - (car (cdr (s-split "--justfile=" arg)))) + (when arg + (car (cdr (s-split "--justfile=" arg))))) (defun justl--get-recipies-with-desc (justfile) "Return all the recipies in JUSTFILE with description." @@ -511,7 +512,7 @@ and output of process." (defun justl-exec-default-recipe () "Execute default recipe." (interactive) - (justl--exec-without-justfile justl-executable (list "default"))) + (justl--exec-without-justfile justl-executable nil)) (defvar justl-mode-map (let ((map (make-sparse-keymap))) From 6f6c1332cd606df4d192fa265421c60351a63950 Mon Sep 17 00:00:00 2001 From: Sibi Prabakaran Date: Thu, 22 Dec 2022 22:16:19 +0530 Subject: [PATCH 3/3] Update emacs version --- .github/workflows/check.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 06b0043..b757493 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -15,7 +15,7 @@ jobs: fail-fast: false matrix: emacs_version: - - 28.1 + - 28.2 - 27.2 - 26.3 ignore_warnings: @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v2 - uses: extractions/setup-just@v1 with: - just-version: 1.0.0 + just-version: 1.8.0 - uses: purcell/setup-emacs@master with: version: ${{ matrix.emacs_version }}