mikes-macos-developer-disk-cleanup 1.0.0 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
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. Clone this repository: `git clone https://github.com/cunneen/mikes-macos-developer-disk-cleanup.git cleanup`
35
- 2. Navigate to the directory where the script is located using the `cd` command: `cd cleanup`
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
- DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
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
- # # remove everything in ~/Library/Caches
119
- # source "${DIR}/modules/library-caches.sh"
120
- # libraryCaches
123
+ # remove everything in ~/Library/Caches
124
+ source "${DIR}/modules/library-caches.sh"
125
+ libraryCaches
121
126
 
122
- # # remove everything from Trash - this sometimes prompts for confirmation
123
- # source "${DIR}/modules/trash.sh"
124
- # trash
127
+ # remove everything from Trash - this sometimes prompts for confirmation
128
+ source "${DIR}/modules/trash.sh"
129
+ trash
125
130
 
126
- # # meteor
127
- # source "${DIR}/modules/meteor-builds-and-packages.sh"
128
- # meteorBuildsAndPackages
131
+ # meteor
132
+ source "${DIR}/modules/meteor-builds-and-packages.sh"
133
+ meteorBuildsAndPackages
129
134
 
130
- # # npm cache
131
- # source "${DIR}/modules/npm-cache.sh"
132
- # npmCache
135
+ # npm cache
136
+ source "${DIR}/modules/npm-cache.sh"
137
+ npmCache
133
138
 
134
- # # yarn cache
135
- # source "${DIR}/modules/yarn-cache.sh"
136
- # yarnCache
139
+ # yarn cache
140
+ source "${DIR}/modules/yarn-cache.sh"
141
+ yarnCache
137
142
 
138
- # # bun cache
139
- # source "${DIR}/modules/bun-cache.sh"
140
- # bunCache
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,6 +1,6 @@
1
1
  {
2
2
  "name": "mikes-macos-developer-disk-cleanup",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "description": "Cleans up a developer's mac disk space. Aggressively.",
5
5
  "bin": {
6
6
  "mikes-macos-disk-cleanup": "mikes-macos-disk-cleanup.sh"