-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbackup.sh
More file actions
executable file
·26 lines (19 loc) · 998 Bytes
/
backup.sh
File metadata and controls
executable file
·26 lines (19 loc) · 998 Bytes
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
#!/bin/sh
# Display welcome message and info
echo "\nWelcome to automatic Visual Studio Code backup script by Andre Sieverding\n"
echo "Backing up extensions and configurations into repository..."
# Get absolute directory path of current file
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
# Get absolute directory path of vs code installation
vscode_dir="${HOME}/Library/Application Support/Code/User"
# Update extensions-list
echo "Updating extensions-list...\n"
code --list-extensions --show-versions > vscode/extensions-list.txt
# Copy all configurations
echo "Copying files...\n"
cp "${vscode_dir}/settings.json" "${dir}/vscode/settings.json"
# Export Activity Bar configuration from SQLite database
echo "Exporting Activity Bar configuration...\n"
sqlite3 "${vscode_dir}/globalStorage/state.vscdb" "SELECT value FROM ItemTable WHERE key = 'workbench.activity.pinnedViewlets2';" > "${dir}/vscode/activity-bar.json" 2>/dev/null || true
# Done! :)
echo "\nDone ✅\n"