Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

tools: Use top-level await.

Anders Kaseorgcf1eed9c22c9
diff --git a/tools/check-openapi b/tools/check-openapi
index 62239e9c846..6f2f7876ee8 100755
--- a/tools/check-openapi
+++ b/tools/check-openapi
@@ -158,11 +158,6 @@ async function checkFile(file) {
}
}
-(async () => {
- for (const file of files) {
- await checkFile(file);
- }
-})().catch((error) => {
- console.error(error);
- process.exit(1);
-});
+for (const file of files) {
+ await checkFile(file);
+}
diff --git a/tools/screenshots/message-screenshot.js b/tools/screenshots/message-screenshot.js
index 1593aec2ca8..b51e177c45a 100644
--- a/tools/screenshots/message-screenshot.js
+++ b/tools/screenshots/message-screenshot.js
@@ -73,12 +73,9 @@ async function run() {
const imageDir = path.dirname(imagePath);
await fs.promises.mkdir(imageDir, {recursive: true});
await page.screenshot({path: imagePath, clip});
- } catch (error) {
- console.log(error);
- process.exit(1);
} finally {
await browser.close();
}
}
-run();
+await run();
diff --git a/tools/screenshots/thread-screenshot.js b/tools/screenshots/thread-screenshot.js
index 080455a4e91..04942e2f148 100644
--- a/tools/screenshots/thread-screenshot.js
+++ b/tools/screenshots/thread-screenshot.js
@@ -91,12 +91,9 @@ async function run() {
const imageDir = path.dirname(imagePath);
await fs.promises.mkdir(imageDir, {recursive: true});
await page.screenshot({path: imagePath, clip});
- } catch (error) {
- console.log(error);
- process.exit(1);
} finally {
await browser.close();
}
}
-run();
+await run();