Skip to content

Instantly share code, notes, and snippets.

View 0xKira's full-sized avatar
🤔
antui

Kira233 0xKira

🤔
antui
View GitHub Profile
@0xKira
0xKira / vscode-unused-workspace-storage-cleanup.sh
Last active November 15, 2020 14:57 — forked from 3v1n0/vscode-unused-workspace-storage-cleanup.sh
VSCode unused workspaceStorage cleanup
#!/bin/bash
CONFIG_PATH=~/Library/ApplicationSupport/Code
for i in $CONFIG_PATH/User/workspaceStorage/*; do
if [ -f $i/workspace.json ]; then
folder="$(python3 -c "import sys, json; print(json.load(open(sys.argv[1], 'r'))['folder'])" $i/workspace.json 2>/dev/null | sed 's#^file://##;s/+/ /g;s/%\(..\)/\\x\1/g;')"
if [ -n "$folder" ] && [ ! -d "$folder" ]; then
echo "Removing workspace $(basename $i) for deleted folder $folder of size $(du -sh $i|cut -f1)"