Print version when run from CLI with --version or -v

This commit is contained in:
Evan Simkowitz 2024-12-18 09:03:01 -08:00
parent cc6da28032
commit 370c53dac0
No known key found for this signature in database

View File

@ -565,6 +565,15 @@ process.on("uncaughtException", (error) => {
}); });
async function appMain() { async function appMain() {
// Check if the user is requesting the version from the command line, if so, return it and bail out.
const args = process.argv;
if (args?.length > 1 && (args[1] === "--version" || args[1] === "-v")) {
const versionInfo = getWaveVersion();
console.log(`Wave Terminal v${versionInfo.version} (build ${versionInfo.buildTime})`);
electronApp.quit();
return;
}
// Set disableHardwareAcceleration as early as possible, if required. // Set disableHardwareAcceleration as early as possible, if required.
const launchSettings = getLaunchSettings(); const launchSettings = getLaunchSettings();
if (launchSettings?.["window:disablehardwareacceleration"]) { if (launchSettings?.["window:disablehardwareacceleration"]) {