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 Windows equivalent install script #81

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

medallyon
Copy link

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

Copy link
Contributor

@CompeyDev CompeyDev left a 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 the install.sh script by making a request to https://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 the X-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.

@medallyon medallyon requested a review from CompeyDev March 10, 2025 21:30
Copy link
Contributor

@CompeyDev CompeyDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now!

@CompeyDev
Copy link
Contributor

There is one small change required -- the shell script prints the GITHUB_PAT note the first thing before all other stages, but the powershell one, however, prints it after the first stage. Missed this in my review, just realized it.

@medallyon medallyon requested a review from CompeyDev March 11, 2025 13:53
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