shell-integration -> locate-shell-integration-path

Part of #153921
This commit is contained in:
Daniel Imms
2022-07-19 06:18:59 -07:00
parent 13d630d1f8
commit ee636283a9
5 changed files with 11 additions and 11 deletions
+6 -6
View File
@@ -62,20 +62,20 @@ export async function main(argv: string[]): Promise<any> {
}
// Shell integration
else if (args['shell-integration']) {
else if (args['locate-shell-integration-path']) {
// Silently fail when the terminal is not VS Code's integrated terminal
if (process.env['TERM_PROGRAM'] !== 'vscode') {
return;
}
let file: string;
switch (args['shell-integration']) {
// Usage: `[[ "$TERM_PROGRAM" == "vscode" ]] && . "$(code --shell-integration bash)"`
switch (args['locate-shell-integration-path']) {
// Usage: `[[ "$TERM_PROGRAM" == "vscode" ]] && . "$(code --locate-shell-integration-path bash)"`
case 'bash': file = 'shellIntegration-bash.sh'; break;
// Usage: `if ($env:TERM_PROGRAM -eq "vscode") { . "$(code --shell-integration pwsh)" }`
// Usage: `if ($env:TERM_PROGRAM -eq "vscode") { . "$(code --locate-shell-integration-path pwsh)" }`
case 'pwsh': file = 'shellIntegration.ps1'; break;
// Usage: `[[ "$TERM_PROGRAM" == "vscode" ]] && . "$(code --shell-integration zsh)"`
// Usage: `[[ "$TERM_PROGRAM" == "vscode" ]] && . "$(code --locate-shell-integration-path zsh)"`
case 'zsh': file = 'shellIntegration-rc.zsh'; break;
default: throw new Error('Error using --shell-integration: Invalid shell type');
default: throw new Error('Error using --locate-shell-integration-path: Invalid shell type');
}
console.log(join(dirname(FileAccess.asFileUri('', require)).fsPath, 'out', 'vs', 'workbench', 'contrib', 'terminal', 'browser', 'media', file));
}