mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 09:08:48 +01:00
ensure zsh version >= last version used to generate zsh command descriptions (#241357)
fix #241235
This commit is contained in:
@@ -14,6 +14,8 @@ if (platform() === 'win32') {
|
|||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const latestZshVersion = 5.9;
|
||||||
|
|
||||||
const shortDescriptions: Map<string, string> = new Map([
|
const shortDescriptions: Map<string, string> = new Map([
|
||||||
['.', 'Source a file'],
|
['.', 'Source a file'],
|
||||||
[':', 'No effect'],
|
[':', 'No effect'],
|
||||||
@@ -135,7 +137,17 @@ let zshBuiltinsCommandDescriptionsCache = new Map<string, ICommandDetails>();
|
|||||||
async function createCommandDescriptionsCache(): Promise<void> {
|
async function createCommandDescriptionsCache(): Promise<void> {
|
||||||
const cachedCommandDescriptions: Map<string, { shortDescription?: string; description: string; args: string | undefined }> = new Map();
|
const cachedCommandDescriptions: Map<string, { shortDescription?: string; description: string; args: string | undefined }> = new Map();
|
||||||
let output = '';
|
let output = '';
|
||||||
|
const zshVersionOutput = await execAsync('zsh --version').then(r => r.stdout);
|
||||||
|
const zshVersionMatch = zshVersionOutput.match(/zsh (\d+\.\d+)/);
|
||||||
|
if (!zshVersionMatch) {
|
||||||
|
console.error('\x1b[31mFailed to determine zsh version\x1b[0m');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
const zshVersion = parseFloat(zshVersionMatch[1]);
|
||||||
|
if (zshVersion < latestZshVersion) {
|
||||||
|
console.error(`\x1b[31mZsh version must be ${latestZshVersion} or higher\x1b[0m`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
output = await execAsync('pandoc --from man --to markdown --wrap=none < $(man -w zshbuiltins)').then(r => r.stdout);
|
output = await execAsync('pandoc --from man --to markdown --wrap=none < $(man -w zshbuiltins)').then(r => r.stdout);
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
Reference in New Issue
Block a user