2024-10-30 19:06:03 +01:00
|
|
|
#!/usr/bin/env -S npx tsx
|
2023-05-09 11:35:54 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Checks for the presence of a webapp, inspects its version and prints it
|
|
|
|
*/
|
|
|
|
|
2024-10-31 10:07:58 +01:00
|
|
|
import url from "node:url";
|
|
|
|
|
2024-10-30 19:06:03 +01:00
|
|
|
import { versionFromAsar } from "./set-version.js";
|
2023-05-09 11:35:54 +02:00
|
|
|
|
|
|
|
async function main(): Promise<number> {
|
|
|
|
const version = await versionFromAsar();
|
|
|
|
console.log(version);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2024-10-31 10:07:58 +01: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 11:35:54 +02:00
|
|
|
}
|