-
Notifications
You must be signed in to change notification settings - Fork 185
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
feat: Add a script to set up the PATH and install shell completions #295
Conversation
That seems undesirable IMO - running installation script shouldn't prompt at all - we should add entry to |
@@ -0,0 +1,9 @@ | |||
MIT License |
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.
lol
I agree. The shell script writes out |
It would be nice if we bundled the code here into a single JS file and ran that. Pulling in dax in the installer is kinda annoying. |
Okay, I updated this to bundle into one entrypoint, and also removed the dependency on dax (I was just using it for prompts, and it's overkill. Instead I just adapted some of the code from dax, replacing the rust WASM dependencies with js, and published a little library https://jsr.io/@nathanwhit/promptly). That brings the bundled size down to 20KB. Also updated to avoid permission prompts, as suggested. All that's left is to publish to JSR, and then this should be good to go. |
Published to JSR, this should be ready to go. Just need to merge this PR and update |
const selected = await multiSelect( | ||
{ | ||
message: `Set up completions?`, | ||
options: shellsWithCompletion.map((s) => { |
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.
So this is an interactive prompt - are we sure we want to prompt user and require more interaction? I'm fine either way.
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.
For now I'd prefer to have it opt-in, since setting up completions is more invasive that adding to path, and more dependent on your shell setup.
We can change it in the future if it's too annoying
Ref denoland/deno#24157
Written in typescript for maintainability and ease of contribution (I am not good at bash scripts, and I think most people are more comfortable with TS than bash). The downside is that we only support this for deno 1.42 and above. I think this is fine because most people installing deno interactively are likely to be installing new deno versions.
The actual PATH setup logic and general shape is largely adapted from rustup.
Here's what it looks like currently:
Screen.Recording.2024-09-17.at.6.51.06.PM.mov
Some features:
Things I am unsure about: