Skip to content

Commit e1d95be

Browse files
committed
improve build code
1 parent e6d61b5 commit e1d95be

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

build/dev.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ async function watchMain(): Promise<void> {
1515
await context.watch();
1616
await context.serve({ servedir: "./dist/" });
1717
}
18-
async function watchDictionary(): Promise<never> {
18+
async function watchDictionary(): Promise<number> {
1919
const command = new Deno.Command(Deno.execPath(), {
2020
args: [
2121
"run",
@@ -36,12 +36,13 @@ async function watchDictionary(): Promise<never> {
3636
const process = command.spawn();
3737
const status = await process.status;
3838
assert(!status.success);
39-
Deno.exit(status.code);
39+
return status.code;
4040
}
4141
if (import.meta.main) {
4242
if (!await exists(new URL("../dictionary/dictionary.ts", import.meta.url))) {
4343
const Dictionary = await import("../dictionary/build.ts");
4444
await Dictionary.build();
4545
}
46-
await Promise.all([watchDictionary(), watchMain()]);
46+
const [statusCode] = await Promise.all([watchDictionary(), watchMain()]);
47+
Deno.exit(statusCode);
4748
}

0 commit comments

Comments
 (0)