mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-18 23:44:59 +01:00
Make get-version.ts ESM compatible
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
cecea312c6
commit
63f3a834cc
@ -4,6 +4,8 @@
|
|||||||
* Checks for the presence of a webapp, inspects its version and prints it
|
* Checks for the presence of a webapp, inspects its version and prints it
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import url from "node:url";
|
||||||
|
|
||||||
import { versionFromAsar } from "./set-version.js";
|
import { versionFromAsar } from "./set-version.js";
|
||||||
|
|
||||||
async function main(): Promise<number> {
|
async function main(): Promise<number> {
|
||||||
@ -13,7 +15,9 @@ async function main(): Promise<number> {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (require.main === module) {
|
if (import.meta.url.startsWith("file:")) {
|
||||||
|
const modulePath = url.fileURLToPath(import.meta.url);
|
||||||
|
if (process.argv[1] === modulePath) {
|
||||||
main()
|
main()
|
||||||
.then((ret) => {
|
.then((ret) => {
|
||||||
process.exit(ret);
|
process.exit(ret);
|
||||||
@ -22,4 +26,5 @@ if (require.main === module) {
|
|||||||
console.error(e);
|
console.error(e);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user