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

feat: Add gitHubLatestReleaseAssetURL template function #3732

Merged
merged 1 commit into from
Apr 29, 2024
Merged

Conversation

twpayne
Copy link
Owner

@twpayne twpayne commented Apr 29, 2024

Fixes #3725.


Calls to `gitHubLatestReleaseAssetURL` are cached so calling
`gitHubLatestReleaseAssetURL` with the same *owner-repo* will only result in one
call to the GitHub API.
Copy link
Collaborator

Choose a reason for hiding this comment

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

The examples use .chezmoi.os and .chezmoi.arch, but not all releases use the go values presented by that. I wonder if it might be worth using a third example for a tool like ripgrep, written in Rust and therefore using the triples (https://github.com/BurntSushi/ripgrep/releases/tag/14.1.0, e.g., aarch64-apple-darwin).

Copy link
Owner Author

Choose a reason for hiding this comment

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

Good point. Also, Debian and RedHat use different architecture and OS values to GOARCH and GOOS. I wonder if it's worth adding a few extra standard template variables like .chezmoi.rpmArch, .chezmoi.debArch, .chezmoi.rustOS, and .chezmoi.rustArch.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If you’re going to do rustOS, you probably want to just do rustArchTriple since that’s the typical approach.

@twpayne twpayne merged commit a396e3a into master Apr 29, 2024
21 checks passed
@twpayne twpayne deleted the fix-3725 branch April 29, 2024 22:06
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a gitHubLatestReleaseAsset function
2 participants