-
Notifications
You must be signed in to change notification settings - Fork 0
/
vscode.sh
37 lines (32 loc) · 938 Bytes
/
vscode.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# Install VSCode extensions from one sh script
# https://github.com/CoreyMSchafer/dotfiles/blob/master/vscode.sh
# Declare array of extensions
declare -a arr=(
dbaeumer.vscode-eslint
SomewhatStationery.some-sass
wix.vscode-import-cost
stylelint.vscode-stylelint
esbenp.prettier-vscode
Orta.vscode-twoslash-queries
Vue.volar
teabyii.ayu
eamodio.gitlens
pflannery.vscode-versionlens
PKief.material-icon-theme
)
extensions=$(code --list-extensions)
# Define color codes
GREEN='\033[0;32m'
NC='\033[0m' # No Color
RED='\033[0;31m'
for ext in "${arr[@]}"
do
# Run pattern matching with flag quite and ignore case
if echo "$extensions" | grep -qi "^$ext"; then
echo -e "${RED}$ext is already installed. Skipping...${NC}"
else
echo -e "${GREEN}Installing $ext...${NC}"
code --install-extension "$ext"
fi
done