forked from rstudio/rstudio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclean-rstudio
executable file
·43 lines (31 loc) · 1007 Bytes
/
clean-rstudio
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
38
39
40
41
42
43
#!/usr/bin/env bash
set -e
echo "About to delete all per-user RStudio state and settings, proceed with caution!"
echo "(Does not delete Project-specific state in .Rproj.user or global machine state)"
read -p "Press [enter] to continue or Ctrl+C"
PLATFORM=`uname`
# r state
rm -f ~/.RData
rm -f ~/.Rhistory
# global options
rm -rf ~/.config/rstudio
rm -rf ~/.config/RStudio
rm -rf ~/.r/rstudio
# settings and session state
rm -rf ~/.rstudio
# open files and tabs
rm -rf ~/.local/share/rstudio
# desktop state
rm -rf ~/.rstudio-desktop
# crash handler state
rm -f ~/.r/crash-handler-permission
rm -f ~/.r/crash-handler.conf
if [ "${PLATFORM}" = "Darwin" ]; then
# Mac session state
rm -rf ~/Library/Application\ Support/RStudio
# macOS desktop settings
defaults delete com.rstudio.desktop > /dev/null 2>&1 || true
defaults delete com.RStudio.desktop > /dev/null 2>&1 || true
defaults delete org.rstudio.RStudio > /dev/null 2>&1 || true
fi
echo Done cleaning RStudio settings and state