Skip to content

Commit 8f30b27

Browse files
alexveeclealexpdp7
authored andcommitted
Package mdBook
1 parent fef70f2 commit 8f30b27

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

repo/mdbook.ubpkg.sky

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
gh = github_repo("rust-lang/mdBook")
2+
3+
release = gh.latest_release()
4+
5+
rest = {
6+
("macos", "aarch64"): "aarch64-apple-darwin",
7+
("macos", "x86_64"): "x86_64-apple-darwin",
8+
("linux", "x86_64"): "x86_64-unknown-linux-musl",
9+
("linux", "aarch64"): "aarch64-unknown-linux-musl",
10+
("windows", "x86_64"): "x86_64-pc-windows-msvc",
11+
}[(os, arch)]
12+
13+
archive_format = {
14+
"linux": "tar.gz",
15+
"macos": "tar.gz",
16+
"windows": "zip",
17+
}[os]
18+
19+
20+
asset = release.get_asset_url("mdbook-{version}-{rest}.{archive_format}".format(version=release.name(), rest=rest, archive_format=archive_format))
21+
22+
install_binary(extract_from_url(asset, "mdbook"), "mdbook")

0 commit comments

Comments
 (0)