aaronpowell / vscode-profile-switcher

A VS Code extension for switching settings easily
https://marketplace.visualstudio.com/items?itemName=aaronpowell.vscode-profile-switcher&wt.mc_id=profileswitcher-github-aapowell
MIT License
177 stars 19 forks source link

Don't install extensions through the code CLI #47

Open dithpri opened 3 years ago

dithpri commented 3 years ago

The profile switcher invokes an external command to install an extension when switching the profile. binaryFullPath, which is set from getCodeBinary() runs into a similar issue as #46: trying to come up with the code executable's full path is buggy and unreliable.

(getCodeBinary() in my tests returns bin/code. But bin/code is not in $PATH, code is!)

Luckily, there's another way:

vscode.commands.executeCommand('workbench.extensions.installExtension', ext.publisherId);

cf. https://code.visualstudio.com/api/references/commands