-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chooser: Pass justfile path to preview command for default chooser #1759
Conversation
a6c73d4
to
c648b0d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple small comments, otherwise looks good.
c648b0d
to
505be59
Compare
I'm getting a failure on the CI test this time,
|
The default chooser is fzf, and we pass it a command to generate the preview with "just --show" from the recipe name. This has been working well as long as we rely on the default justfile available in the directory, given that the preview command can find it too. However, passing "--chose" alongside "--justfile" to select a specific file results in the preview command not being able to find the right justfile to process. To address this issue, we turn the const string defining the preview command into a function that takes the internal representation of the justfile as an argument, and updates the preview command with the right file. Fixes: 5f9ac39 ("Use `just --show` in default chooser (casey#1539)") Suggested-by: Casey Rodarmor <casey@rodarmor.com>
505be59
to
e06e12a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, LGTM! I added quotes around the path in the chooser string, since it might wind up having spaces.
The default chooser is fzf, and we pass it a command to generate the preview with
just --show
from the recipe name. This has been working well as long as we rely on the default justfile available in the directory, given that the preview command can find it too. However, passing--chose
alongside--justfile
to select a specific file results in the preview command not being able to find the right justfile to process.To address this issue, we turn the const string defining the preview command into a function that takes the internal representation of the justfile as an argument, and updates the preview command with the right file.
Fixes: #1638