Skip to content

Commit 07fb76f

Browse files
committed
+bun
1 parent 635b8b5 commit 07fb76f

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

projects/bun.sh/build.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { BuildOptions, Path, unarchive } from "brewkit";
2+
3+
export default async function ({ prefix, version }: BuildOptions) {
4+
const arch = (() => {
5+
switch (`${Deno.build.os}/${Deno.build.arch}`) {
6+
case "darwin/x86_64":
7+
return "darwin-x64";
8+
case "linux/x86_64":
9+
return "linux-x64";
10+
case "windows/x86_64":
11+
return "windows-x64";
12+
case "linux/aarch64":
13+
return "linux-aarch64";
14+
case "darwin/aarch64":
15+
return "darwin-aarch64";
16+
default:
17+
throw new Error("Unsupported platform");
18+
}
19+
})();
20+
21+
await unarchive(`https://github.com/oven-sh/bun/releases/download/bun-v${version}/bun-${arch}.zip`);
22+
const exe = Deno.build.os == "windows" ? 'bun.exe' : 'bun';
23+
Path.cwd().join(`bun-${arch}`, exe).mv({ into: prefix.bin.mkdir('p') });
24+
}

projects/bun.sh/package.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name:
2+
bun
3+
4+
repository:
5+
https://github.com/oven-sh/bun
6+
7+
programs:
8+
- bin/bun
9+
10+
platforms:
11+
- darwin/aarch64
12+
- darwin/x86-64
13+
- linux/aarch64
14+
- linux/x86-64
15+
- windows/x86-64

projects/bun.sh/test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { run } from "brewkit";
2+
3+
export default function() {
4+
run`bun --version`;
5+
}

0 commit comments

Comments
 (0)