mikes-macos-developer-disk-cleanup 1.0.1 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -4
- package/mikes-macos-disk-cleanup.sh +24 -19
- package/package.json +2 -3
package/README.md
CHANGED
@@ -31,10 +31,8 @@ Currently it searches for (and cleans) the following items:
|
|
31
31
|
|
32
32
|
## How to Use the Script
|
33
33
|
|
34
|
-
1.
|
35
|
-
2.
|
36
|
-
3. Run the script by typing `./mikes-macos-disk-cleanup.sh`.
|
37
|
-
4. Panic because all your files are now gone and are never coming back.
|
34
|
+
1. `npx mikes-macos-developer-disk-cleanup`
|
35
|
+
2. Panic because all your files are now gone and are never coming back.
|
38
36
|
|
39
37
|
## Important Notes
|
40
38
|
|
@@ -84,7 +84,12 @@ INITIALISED=1 # set to 1 so that the script will not prompt again (only really m
|
|
84
84
|
|
85
85
|
# ==== END OF CONFIGURATION ====
|
86
86
|
# get the full path for the current dir
|
87
|
-
|
87
|
+
# - if this is being run via "npx" then "${BASH_SOURCE[0]}" will be a symlink,
|
88
|
+
# so we need to get the full path to the script (and not just the symlink) so
|
89
|
+
# we can load the modules from the correct location
|
90
|
+
|
91
|
+
RESOLVED_SOURCE="$(node -e "const path = require('path');fs = require('fs');console.log(fs.realpathSync('${BASH_SOURCE[0]}'));")"
|
92
|
+
DIR=$(dirname "${RESOLVED_SOURCE}")
|
88
93
|
|
89
94
|
# ===== Error handling =======
|
90
95
|
# set -e: exit on error
|
@@ -115,29 +120,29 @@ INITIALSPACE=$(
|
|
115
120
|
)
|
116
121
|
echo "DISK USAGE BEFORE CLEANUP: ${INITIALSPACE}"
|
117
122
|
|
118
|
-
#
|
119
|
-
|
120
|
-
|
123
|
+
# remove everything in ~/Library/Caches
|
124
|
+
source "${DIR}/modules/library-caches.sh"
|
125
|
+
libraryCaches
|
121
126
|
|
122
|
-
#
|
123
|
-
|
124
|
-
|
127
|
+
# remove everything from Trash - this sometimes prompts for confirmation
|
128
|
+
source "${DIR}/modules/trash.sh"
|
129
|
+
trash
|
125
130
|
|
126
|
-
#
|
127
|
-
|
128
|
-
|
131
|
+
# meteor
|
132
|
+
source "${DIR}/modules/meteor-builds-and-packages.sh"
|
133
|
+
meteorBuildsAndPackages
|
129
134
|
|
130
|
-
#
|
131
|
-
|
132
|
-
|
135
|
+
# npm cache
|
136
|
+
source "${DIR}/modules/npm-cache.sh"
|
137
|
+
npmCache
|
133
138
|
|
134
|
-
#
|
135
|
-
|
136
|
-
|
139
|
+
# yarn cache
|
140
|
+
source "${DIR}/modules/yarn-cache.sh"
|
141
|
+
yarnCache
|
137
142
|
|
138
|
-
#
|
139
|
-
|
140
|
-
|
143
|
+
# bun cache
|
144
|
+
source "${DIR}/modules/bun-cache.sh"
|
145
|
+
bunCache
|
141
146
|
|
142
147
|
# ### XCode ###
|
143
148
|
source "${DIR}/modules/xcode-artifacts.sh"
|
package/package.json
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
{
|
2
2
|
"name": "mikes-macos-developer-disk-cleanup",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.3",
|
4
4
|
"description": "Cleans up a developer's mac disk space. Aggressively.",
|
5
5
|
"bin": {
|
6
|
-
"mikes-macos-disk-cleanup": "mikes-macos-disk-cleanup.sh"
|
7
|
-
"modules": "modules"
|
6
|
+
"mikes-macos-disk-cleanup": "mikes-macos-disk-cleanup.sh"
|
8
7
|
},
|
9
8
|
"scripts": {
|
10
9
|
"test": "echo \"Error: no test specified\" && exit 1"
|