From 370c53dac01e01833b369717c3fe5401a8d57f10 Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Wed, 18 Dec 2024 09:03:01 -0800 Subject: [PATCH] Print version when run from CLI with `--version` or `-v` --- emain/emain.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/emain/emain.ts b/emain/emain.ts index a4511db45..76c2d731d 100644 --- a/emain/emain.ts +++ b/emain/emain.ts @@ -565,6 +565,15 @@ process.on("uncaughtException", (error) => { }); 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. const launchSettings = getLaunchSettings(); if (launchSettings?.["window:disablehardwareacceleration"]) {