mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-10 14:30:03 +00:00
Fix the problem that the Developer Prompt for VS 2022
profile could not be loaded
This commit is contained in:
parent
fa2bbe39c4
commit
7cddcee951
@ -27,30 +27,32 @@ export class VSDevToolsProvider extends ShellProvider {
|
|||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
|
||||||
const parentPath = path.join(process.env['programfiles(x86)'] ?? 'C:\\Program Files (x86', 'Microsoft Visual Studio')
|
const x86ParentPath = path.join(process.env['programfiles(x86)'] ?? 'C:\\Program Files (x86)', 'Microsoft Visual Studio')
|
||||||
|
const x64ParentPath = path.join(process.env['programfiles'] ?? 'C:\\Program Files', 'Microsoft Visual Studio')
|
||||||
try {
|
|
||||||
await fs.stat(parentPath)
|
|
||||||
} catch {
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
|
|
||||||
const result: Shell[] = []
|
const result: Shell[] = []
|
||||||
for (const version of await fs.readdir(parentPath)) {
|
for (const parentPath of [x86ParentPath, x64ParentPath]) {
|
||||||
const bat = path.join(parentPath, version, 'Community\\Common7\\Tools\\VsDevCmd.bat')
|
|
||||||
try {
|
try {
|
||||||
await fs.stat(bat)
|
await fs.stat(parentPath)
|
||||||
} catch {
|
for (const version of await fs.readdir(parentPath)) {
|
||||||
continue
|
const bat = path.join(parentPath, version, 'Community\\Common7\\Tools\\VsDevCmd.bat')
|
||||||
|
try {
|
||||||
|
await fs.stat(bat)
|
||||||
|
} catch {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
result.push({
|
||||||
|
id: `vs-cmd-${version}`,
|
||||||
|
name: `Developer Prompt for VS ${version}`,
|
||||||
|
command: 'cmd.exe',
|
||||||
|
args: ['/k', bat],
|
||||||
|
icon: vsIconMap[version],
|
||||||
|
env: {},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} catch (_) {
|
||||||
|
// Ignore
|
||||||
}
|
}
|
||||||
result.push({
|
|
||||||
id: `vs-cmd-${version}`,
|
|
||||||
name: `Developer Prompt for VS ${version}`,
|
|
||||||
command: 'cmd.exe',
|
|
||||||
args: ['/k', bat],
|
|
||||||
icon: vsIconMap[version],
|
|
||||||
env: {},
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user