Skip to content

Commit a6f2267

Browse files
flovogtmatz3
authored andcommitted
Refactor scripts/buildSchema.js to work with top level await
1 parent 446be6a commit a6f2267

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.eslintrc.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = {
44
},
55
"env": {
66
"node": true,
7-
"es2021": true
7+
"es2022": true
88
},
99
"extends": ["eslint:recommended", "google"],
1010
"plugins": [],

scripts/buildSchema.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const TARGET_SCHEMA_PATH = fileURLToPath(
1717
new URL(`../site/schema/ui5.yaml.json`, import.meta.url)
1818
);
1919

20-
async function main() {
20+
try {
2121
const parser = new $RefParser();
2222
const schema = await parser.bundle(SOURCE_SCHEMA_PATH);
2323

@@ -47,9 +47,8 @@ async function main() {
4747
await writeFile(TARGET_SCHEMA_PATH, JSON.stringify(schema, null, 2));
4848

4949
console.log("Wrote bundled ui5.yaml schema file to " + TARGET_SCHEMA_PATH);
50-
}
51-
52-
main().catch((error) => {
50+
} catch (error) {
5351
console.log(error);
5452
process.exit(1);
55-
});
53+
}
54+

0 commit comments

Comments
 (0)