Skip to content

Commit

Permalink
Package gh
Browse files Browse the repository at this point in the history
  • Loading branch information
alexveecle authored and alexpdp7 committed Jul 26, 2024
1 parent 4ababb0 commit be61a0c
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions repo/gh.ubpkg.sky
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
gh = github_repo("cli/cli")

release = gh.latest_release()
version_str = release.name().removeprefix("v")

os_str = {
"linux": "linux",
"macos": "macOS",
"windows": "windows",
}[os]

arch_str = {
"x86_64": "amd64",
"aarch64": "arm64",
}[arch]

archive_format = {
"linux": "tar.gz",
"macos": "zip",
"windows": "zip",
}[os]

part = "gh_{version_str}_{os_str}_{arch_str}".format(version_str=version_str, os_str=os_str, arch_str=arch_str)

asset = release.get_asset_url("{part}.{archive_format}".format(part=part, archive_format=archive_format))

install_binary(extract_from_url(asset, "{part}/bin/gh".format(part=part)), "gh")

0 comments on commit be61a0c

Please sign in to comment.