Skip to content

Instantly share code, notes, and snippets.

@Joaquin6
Created May 28, 2019 07:52
Show Gist options
  • Save Joaquin6/d15a072737167680fa74199f0115c5d5 to your computer and use it in GitHub Desktop.
Save Joaquin6/d15a072737167680fa74199f0115c5d5 to your computer and use it in GitHub Desktop.
This is the bash script I use to install a set of extensions to both the stable and insiders channels of VS Code. It should work on Linux, OS X and Windows (using git bash or something similar)
EXTENSIONS=(
"cssho.vscode-svgviewer" \
"dbaeumer.vscode-eslint" \
"EditorConfig.EditorConfig" \
"ryzngard.vscode-header-source" \
"spywhere.guides" \
"Tyriar.sort-lines" \
"Tyriar.lorem-ipsum" \
"waderyan.gitblame"
)
for VARIANT in "code" \
"code-insiders"
do
if hash $VARIANT 2>/dev/null; then
echo "Installing extensions for $VARIANT"
for EXTENSION in ${EXTENSIONS[@]}
do
$VARIANT --install-extension $EXTENSION
done
fi
done
@Joaquin6
Copy link
Author

Version 1.2.0 of VS Code landed in the Stable channel on Monday the 6th of June and brought the following new command line args to code:

code --list-extensions
code --install-extension <extension>
code --uninstall-extension <extension>

These finally allow an official mechanism to script extension installs, making it easier to maintain a consistent development environment across machines.

To customize this just replace the contents of the EXTENSIONS variable at the top with the IDs of your own preferred extensions. The easiest way to get the extension IDs is by installing the extension locally and running code --list-extensions. They can also be retrieved from the marketplace URL.

https://www.growingwiththeweb.com/images/2016/06/06/marketplace_url.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment