File tree 3 files changed +21
-18
lines changed
3 files changed +21
-18
lines changed Original file line number Diff line number Diff line change @@ -14,18 +14,19 @@ The `@taggedTemplate` decorator is used to bind to JavaScript tag functions.
14
14
<CodeTab labels = { [" ReScript" , " JS Output" ]} >
15
15
16
16
``` res example
17
- type res
18
- @module("bun") @taggedTemplate
19
- external sh: (array<string>, array<string>) => promise<res> = "$"
17
+ // see https://bun.sh/docs/runtime/shell
18
+ type result = {exitCode: int}
19
+ @module("bun") @taggedTemplate
20
+ external sh: (array<string>, array<string>) => promise<result> = "$"
20
21
21
22
let filename = "index.res"
22
- let res = await sh`ls ${filename}`
23
+ let result = await sh`ls ${filename}`
23
24
```
24
25
25
26
``` js
26
27
import * as $$Bun from " bun" ;
27
- var filename = " index.res"
28
- var res = await $$Bun .$ ` ls ${ filename} `
28
+ var filename = " index.res" ;
29
+ var result = await $$Bun .$ ` ls ${ filename} ` ;
29
30
```
30
31
31
32
</CodeTab >
Original file line number Diff line number Diff line change @@ -435,18 +435,19 @@ You add the `@taggedTemplate` annotation and you're good to go!
435
435
<CodeTab labels = { [" ReScript" , " JS Output" ]} >
436
436
437
437
``` res example
438
- type res
439
- @module("bun") @taggedTemplate
440
- external sh: (array<string>, array<string>) => promise<res> = "$"
438
+ // see https://bun.sh/docs/runtime/shell
439
+ type result = {exitCode: int}
440
+ @module("bun") @taggedTemplate
441
+ external sh: (array<string>, array<string>) => promise<result> = "$"
441
442
442
443
let filename = "index.res"
443
- let res = await sh`ls ${filename}`
444
+ let result = await sh`ls ${filename}`
444
445
```
445
446
446
447
``` js
447
448
import * as $$Bun from " bun" ;
448
- var filename = " index.res"
449
- var res = await $$Bun .$ ` ls ${ filename} `
449
+ var filename = " index.res" ;
450
+ var result = await $$Bun .$ ` ls ${ filename} ` ;
450
451
```
451
452
452
453
</CodeTab >
Original file line number Diff line number Diff line change @@ -199,18 +199,19 @@ external join: array<string> => string = "join"
199
199
<CodeTab labels = { [" ReScript" , " JS Output" ]} >
200
200
201
201
``` res example
202
- type res
203
- @module("bun") @taggedTemplate
204
- external sh: (array<string>, array<string>) => promise<res> = "$"
202
+ // see https://bun.sh/docs/runtime/shell
203
+ type result = {exitCode: int}
204
+ @module("bun") @taggedTemplate
205
+ external sh: (array<string>, array<string>) => promise<result> = "$"
205
206
206
207
let filename = "index.res"
207
- let res = await sh`ls ${filename}`
208
+ let result = await sh`ls ${filename}`
208
209
```
209
210
210
211
``` js
211
212
import * as $$Bun from " bun" ;
212
- var filename = " index.res"
213
- var res = await $$Bun .$ ` ls ${ filename} `
213
+ var filename = " index.res" ;
214
+ var result = await $$Bun .$ ` ls ${ filename} ` ;
214
215
```
215
216
216
217
</CodeTab >
You can’t perform that action at this time.
0 commit comments