From 9b33ebf8593a3cf47d494b7595d6c043c4f2cd88 Mon Sep 17 00:00:00 2001 From: Sibi Prabakaran Date: Fri, 15 Nov 2024 11:12:11 +0530 Subject: [PATCH] Handle private recipes for interactive prompts too --- justl.el | 10 +++++----- test/justl-test.el | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/justl.el b/justl.el index 9c9c5a9..9334681 100644 --- a/justl.el +++ b/justl.el @@ -434,10 +434,13 @@ Logs the command run." "Return all the recipes from JUSTFILE. They are returned as objects, as per the JSON output of \"just --dump\"." (let-alist (justl--parse justfile) - (mapcar (lambda (x) (make-recipe :name (alist-get 'name x) + (let ((all-recipes (mapcar (lambda (x) (make-recipe :name (alist-get 'name x) :doc (alist-get 'doc x) :parameters (alist-get 'parameters x) :private (alist-get 'private x))) .recipes))) + (if justl-include-private-recipes + all-recipes + (seq-filter (lambda (recipe) (not (justl--recipe-private-p recipe))) all-recipes))))) ;;; todo: For easily integrating it, we need something like this ;;; integrated upstream: @@ -530,10 +533,7 @@ They are returned as objects, as per the JSON output of \"just --dump\"." (justl--recipe-name r) (vector (propertize (justl--recipe-name r) 'recipe r) (or (justl--recipe-desc r) "")))) - (seq-filter (lambda (r) - (or justl-include-private-recipes - (not (justl--recipe-private-p r)))) - recipes))) + recipes)) (defun justl-exec-eshell (&optional no-send) "Execute just recipe in eshell. diff --git a/test/justl-test.el b/test/justl-test.el index 8df92b4..b7e487a 100644 --- a/test/justl-test.el +++ b/test/justl-test.el @@ -10,7 +10,7 @@ (ert-deftest justl--get-recipes-test () (should (equal - (list "default" "build-cmd" "plan" "push" "push2" "fail" "carriage-return" "color" "_private") + (list "default" "build-cmd" "plan" "push" "push2" "fail" "carriage-return" "color") (mapcar 'justl--recipe-name (justl--get-recipes "./justfile"))))) (ert-deftest justl--get-description-test ()