-
Notifications
You must be signed in to change notification settings - Fork 15
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 Windows equivalent install script #81
base: main
Are you sure you want to change the base?
Conversation
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.
It seems to work fine but a few changes are required:
- You seem to be visiting the
latest
release URL, waiting for it to redirect, and capturing the version that it redirects to -- which is kind of a hack. A more proper solution would be to use the GitHub API like we do in theinstall.sh
script by making a request tohttps://api.github.com/repos/$REPOSITORY/releases/latest
and extracting the version returned by that. You would also want to pin the GitHub API version using theX-GitHub-Api-Version
header in order to prevent breakages of the script when GitHub updates their API in the future. - The script output seems very different from that of the UNIX install script. We probably want them both to be similar for parity's sake. Here's how it looks for
install.sh
:
[1 / 3] Looking for latest rokit release
[2 / 3] Downloading 'rokit-1.0.0-linux-x86_64.zip'
[3 / 3] Running rokit installation
🚀 Rokit links are already up-to-date. (took 55.58ms)
Run `rokit --help` to get started using Rokit.
- We can modularize the script a bit more by not hardcoding the repository path into the API / download URLs and instead have them in a constant and format that into the strings.
- You would need to support providing a GitHub API token using the
GITHUB_PAT
environment variable, in order to bypass ratelimits.
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.
Looks good now!
There is one small change required -- the shell script prints the |
I'm a fan of finding ways to make installation of tools easier on Windows (choco-style). Added the option to run an install command in PowerShell identical to the linux install command and added instructions to the README. Tested on Windows 10 & Windows 11.
In the future, I'd love to be able to install rokit via Chocolatey:
choco install rokit