Files
element-web/scripts/get-version.ts
T

31 lines
679 B
TypeScript
Raw Normal View History

2024-10-30 18:06:03 +00:00
#!/usr/bin/env -S npx tsx
2023-05-09 10:35:54 +01:00
/*
* Checks for the presence of a webapp, inspects its version and prints it
*/
2024-10-31 09:07:58 +00:00
import url from "node:url";
2024-10-30 18:06:03 +00:00
import { versionFromAsar } from "./set-version.js";
2023-05-09 10:35:54 +01:00
async function main(): Promise<number> {
const version = await versionFromAsar();
console.log(version);
return 0;
}
2024-10-31 09:07:58 +00:00
if (import.meta.url.startsWith("file:")) {
const modulePath = url.fileURLToPath(import.meta.url);
if (process.argv[1] === modulePath) {
main()
.then((ret) => {
process.exit(ret);
})
.catch((e) => {
console.error(e);
process.exit(1);
});
}
2023-05-09 10:35:54 +01:00
}