diff --git a/repo/jj.ubpkg.sky b/repo/jj.ubpkg.sky new file mode 100644 index 0000000..eadc171 --- /dev/null +++ b/repo/jj.ubpkg.sky @@ -0,0 +1,22 @@ +gh = github_repo("martinvonz/jj") + +release = gh.latest_release() + +rest = { + ("macos", "aarch64"): "aarch64-apple-darwin", + ("macos", "x86_64"): "x86_64-apple-darwin", + ("linux", "x86_64"): "x86_64-unknown-linux-musl", + ("linux", "aarch64"): "aarch64-unknown-linux-musl", + ("windows", "x86_64"): "x86_64-pc-windows-msvc", +}[(os, arch)] + +archive_format = { + "linux": "tar.gz", + "macos": "tar.gz", + "windows": "zip", +}[os] + + +asset = release.get_asset_url("jj-{version}-{rest}.{archive_format}".format(version=release.name(), rest=rest, archive_format=archive_format)) + +install_binary(extract_from_url(asset, "jj"), "jj")