0%

JetBrains编辑器清理(mac)

缘由

由于不可描述的原因,我需要将JetBrains的所有已安装的编辑器进行清理。但我们知道MAC上单纯将应用软件中的软件拖入废纸篓是无法进行彻底删除的。

Tip: 有Cleaner One Pro或者clean my mac 专业版的(也就是付费版)的朋友可以直接在该软件中进行软件的卸载与清理,具体操作便不再此过多赘述

关键目录

1
2
3
4
5
~/Library/Application\ Support/JetBrains
~/Library/Logs/JetBrains
~/Library/Preferences/JetBrains.*
~/Library/Caches/JetBrains
/Applications

删除

Tip:建议先将/Applications 中的内容先进行删除

1
2
3
4
rm -rf ~/Library/Application\ Support/JetBrains/*
rm -rf ~/Library/Logs/JetBrains/*
rm -rf ~/Library/Preferences/JetBrains.*
rm -rf ~/Library/Caches/JetBrains/*

Evalreset Cleanr Script

Mac/Linux

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
#!/usr/bin/env sh
# reset jetbrains ide evals

OS_NAME=$(uname -s)
JB_PRODUCTS="IntelliJIdea CLion PhpStorm GoLand PyCharm WebStorm Rider DataGrip RubyMine AppCode"

if [ $OS_NAME == "Darwin" ]; then
echo 'macOS:'

rm -rf ~/Library/Logs/JetBrains/*
rm -rf ~/Library/Caches/JetBrains/*
rm -rf ~/Library/Preferences/JetBrains.*
for PRD in $JB_PRODUCTS; do
rm -rf ~/Library/Preferences/${PRD}*/*
rm -rf ~/Library/Application\ Support/JetBrains/${PRD}*/eval
done
elif [ $OS_NAME == "Linux" ]; then
echo 'Linux:'

for PRD in $JB_PRODUCTS; do
rm -rf ~/.${PRD}*/config/eval
rm -rf ~/.config/${PRD}*/eval
done
else
echo 'unsupport'
exit
fi

echo 'done.'

Windows

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
Set oShell = CreateObject("WScript.Shell")
Set oFS = CreateObject("Scripting.FileSystemObject")
sHomeFolder = oShell.ExpandEnvironmentStrings("%USERPROFILE%")
sJBDataFolder = oShell.ExpandEnvironmentStrings("%APPDATA%") + "\JetBrains"

Set re = New RegExp
re.Global = True
re.IgnoreCase = True
re.Pattern = "\.?(IntelliJIdea|GoLand|CLion|PyCharm|DataGrip|RubyMine|AppCode|PhpStorm|WebStorm|Rider).*"

Sub removeEval(ByVal file, ByVal sEvalPath)
bMatch = re.Test(file.Name)
If Not bMatch Then
Exit Sub
End If

If oFS.FolderExists(sEvalPath) Then
oFS.DeleteFolder sEvalPath, True
End If
End Sub

If oFS.FolderExists(sHomeFolder) Then
For Each oFile In oFS.GetFolder(sHomeFolder).SubFolders
removeEval oFile, sHomeFolder + "\" + oFile.Name + "\config\eval"
Next
End If

If oFS.FolderExists(sJBDataFolder) Then
For Each oFile In oFS.GetFolder(sJBDataFolder).SubFolders
removeEval oFile, sJBDataFolder + "\" + oFile.Name + "\eval"
Next
End If

MsgBox "done"

qXHrKqdrtjJX6xtX

vrg123 : 4565

zhile

Zhile-plug: https://plugins.zhile.io