File tree Expand file tree Collapse file tree 3 files changed +44
-0
lines changed
Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 1+ import { run } from "brewkit" ;
2+
3+ export default function ( ) {
4+ run `bun --version` ;
5+ }
You can’t perform that action at this time.
0 commit comments