-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbackup.bat
More file actions
36 lines (28 loc) · 1.02 KB
/
backup.bat
File metadata and controls
36 lines (28 loc) · 1.02 KB
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
@echo off & setlocal
REM Display welcome message and info
echo\
echo Welcome to automatic Visual Studio Code backup script by Andre Sieverding
echo\
echo Backing up extensions and configurations into repository...
echo\
REM Get absolute directory path of current file and remove last character (backslash)
SET dir=%~dp0
SET dir=%dir:~0,-1%
REM Get absolute directory path of vs code installation
SET vscode_dir=%systemdrive%%homepath%\AppData\Roaming\Code\User
REM Copy all configurations
echo Copying files...
echo\
copy "%vscode_dir%\settings.json" "%dir%\vscode\settings.json"
REM Export Activity Bar configuration from SQLite database
echo Exporting Activity Bar configuration...
echo\
sqlite3 "%vscode_dir%\globalStorage\state.vscdb" "SELECT value FROM ItemTable WHERE key = 'workbench.activity.pinnedViewlets2';" > "%dir%\vscode\activity-bar.json" 2>nul
REM Update extensions-list
echo Updating extensions-list...
echo\
code --list-extensions --show-versions > vscode\extensions-list.txt && exit 1
echo Done! :)
echo\
pause
endlocal