File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -45,14 +45,19 @@ async function watchDictionary(): Promise<number> {
45
45
return status . code ;
46
46
}
47
47
if ( import . meta. main ) {
48
- if ( ! await exists ( new URL ( "../dictionary/dictionary.ts" , import . meta. url ) ) ) {
49
- const Dictionary = await import ( "../dictionary/build.ts" ) ;
50
- await Dictionary . build ( ) ;
48
+ let statusCode : number ;
49
+ {
50
+ await using stack = new AsyncDisposableStack ( ) ;
51
+ if (
52
+ ! await exists ( new URL ( "../dictionary/dictionary.ts" , import . meta. url ) )
53
+ ) {
54
+ const Dictionary = await import ( "../dictionary/build.ts" ) ;
55
+ await Dictionary . build ( ) ;
56
+ }
57
+ const statusCodePromise = watchDictionary ( ) ;
58
+ const context = await watchMain ( ) ;
59
+ stack . defer ( async ( ) => await context . dispose ( ) ) ;
60
+ statusCode = await statusCodePromise ;
51
61
}
52
- const [ statusCode , context ] = await Promise . all ( [
53
- watchDictionary ( ) ,
54
- watchMain ( ) ,
55
- ] ) ;
56
- await context . dispose ( ) ;
57
62
Deno . exit ( statusCode ) ;
58
63
}
You can’t perform that action at this time.
0 commit comments