Fix version copy for missing cli
This commit is contained in:
committed by
Shati Patel
parent
df18ff3052
commit
31db2ffb82
@@ -792,11 +792,19 @@ async function activateWithInstalledDistribution(
|
|||||||
|
|
||||||
ctx.subscriptions.push(
|
ctx.subscriptions.push(
|
||||||
commandRunner('codeQL.copyVersion', async () => {
|
commandRunner('codeQL.copyVersion', async () => {
|
||||||
const text = `CodeQL extension version: ${extension?.packageJSON.version} \nCodeQL CLI version: ${await cliServer.getVersion()} \nPlatform: ${os.platform()} ${os.arch()}`;
|
const text = `CodeQL extension version: ${extension?.packageJSON.version} \nCodeQL CLI version: ${await getCliVersion()} \nPlatform: ${os.platform()} ${os.arch()}`;
|
||||||
await env.clipboard.writeText(text);
|
await env.clipboard.writeText(text);
|
||||||
void helpers.showAndLogInformationMessage(text);
|
void helpers.showAndLogInformationMessage(text);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
const getCliVersion = async () => {
|
||||||
|
try {
|
||||||
|
return await cliServer.getVersion();
|
||||||
|
} catch {
|
||||||
|
return '<missing>';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// The "authenticateToGitHub" command is internal-only.
|
// The "authenticateToGitHub" command is internal-only.
|
||||||
ctx.subscriptions.push(
|
ctx.subscriptions.push(
|
||||||
commandRunner('codeQL.authenticateToGitHub', async () => {
|
commandRunner('codeQL.authenticateToGitHub', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user