Skip to content
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

Add ability to install packages without selecting from a prompt #20

Merged
merged 4 commits into from
Oct 19, 2023

Conversation

JoshMock
Copy link
Contributor

Adds an --install arg that takes a list of docset IDs and installs them, rather than selecting from an interactive prompt. This makes it easier to automate several docsets at a time by removing the need for interactivity.

Also adds a --list-all flag that prints all docset names and their IDs, and exits, so that those wanting to use --install have an easy source to work with.

I chose to disable the progress bar when installing multiple docsets at once, because many of the async operations' logs were tripping over each other. This could be improved by being able to give each progress bar its own line and updating it in place asynchronously, but that was more than I had time for today.

@JoshMock
Copy link
Contributor Author

Output looks like this when installing multiple docsets:

❯ npm run prepack && ./bin/dev --install Matrix logstash    

> [email protected] prepack
> rm -rf lib && tsc -b

    info Downloading docset from https://london.kapeli.com/feeds/zzz/user_contributed/build/logstash/logstash.tgz
    info Downloading docset from https://newyork.kapeli.com/feeds/zzz/user_contributed/build/Matrix/Matrix.tgz
    info Extracting docset to /home/joshmock/.local/share/Zeal/Zeal/docsets/Matrix.docset
    info Writing icon to /home/joshmock/.local/share/Zeal/Zeal/docsets/Matrix.docset/icon.png
    info Writing icon@2x to /home/joshmock/.local/share/Zeal/Zeal/docsets/Matrix.docset/[email protected]
    info Writing metadata to /home/joshmock/.local/share/Zeal/Zeal/docsets/Matrix.docset/meta.json
 success Successfully added the Matrix docset to Zeal
    info Extracting docset to /home/joshmock/.local/share/Zeal/Zeal/docsets/logstash.docset
    info Writing icon to /home/joshmock/.local/share/Zeal/Zeal/docsets/logstash.docset/icon.png
    info Writing icon@2x to /home/joshmock/.local/share/Zeal/Zeal/docsets/logstash.docset/[email protected]
    info Writing metadata to /home/joshmock/.local/share/Zeal/Zeal/docsets/logstash.docset/meta.json
 success Successfully added the Logstash docset to Zeal
    info If Zeal is running, make sure to restart it for the docset to show up

@jmerle jmerle merged commit 963f602 into jmerle:master Oct 19, 2023
1 check passed
@jmerle
Copy link
Owner

jmerle commented Oct 19, 2023

Sorry for the delay, I forgot about the existence of this PR. It looks good overall, I made some minor changes and will publish a new release within a few hours. Thank you!

@JoshMock
Copy link
Contributor Author

Appreciated! Thanks for the useful tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants