Skip to content

Commit 31db2ff

Browse files
mgsiumshati-patel
authored andcommitted
Fix version copy for missing cli
1 parent df18ff3 commit 31db2ff

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

extensions/ql-vscode/src/extension.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,11 +792,19 @@ async function activateWithInstalledDistribution(
792792

793793
ctx.subscriptions.push(
794794
commandRunner('codeQL.copyVersion', async () => {
795-
const text = `CodeQL extension version: ${extension?.packageJSON.version} \nCodeQL CLI version: ${await cliServer.getVersion()} \nPlatform: ${os.platform()} ${os.arch()}`;
795+
const text = `CodeQL extension version: ${extension?.packageJSON.version} \nCodeQL CLI version: ${await getCliVersion()} \nPlatform: ${os.platform()} ${os.arch()}`;
796796
await env.clipboard.writeText(text);
797797
void helpers.showAndLogInformationMessage(text);
798798
}));
799799

800+
const getCliVersion = async () => {
801+
try {
802+
return await cliServer.getVersion();
803+
} catch {
804+
return '<missing>';
805+
}
806+
};
807+
800808
// The "authenticateToGitHub" command is internal-only.
801809
ctx.subscriptions.push(
802810
commandRunner('codeQL.authenticateToGitHub', async () => {

0 commit comments

Comments
 (0)