mikes-macos-developer-disk-cleanup 1.0.8 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.env CHANGED
@@ -5,4 +5,4 @@
5
5
  DOTENV_PUBLIC_KEY="036dc3b1c538f3b753f28504685c42364d6aa3fd3cdc0d544ffab9dbe9c8d2afef"
6
6
 
7
7
  # .env
8
- GITHUB_TOKEN="encrypted:BNnSFezPjmz67d7bbIftawwuKLB65j8o5QStETBFPmMqZMlWMk0V1qF1NkhYKFvMcnjsv/qIV+1gT/Dkt4IzGZu8bXGhJ6cBfpZJ/QP79YvYGvrn/4qCLj/QsBtsNZc2iCpDJvU7dAzey7gi+2qCCDkZpjv042tsZtTcviAK+JbF31UBqsYTjxSM2FcaXwlbGlQjx6ygDk5AXJbTtQpCa1iAjfeW7ma9MypeKGGfSUBkCDMW42MZmXJZ+TN/Dw=="
8
+ GITHUB_TOKEN="encrypted:BDXSoNLrWFQCQpL2MYnEhmCdGz0TR7znqFIMghNtujL0ADFC5shdKOG/kq7dS1i62whj0gBxZLZYXpg8babGmf9fPM2fBCTxKEgOuSYlRItCYPK4neGRDmonuaj7OOQADGLSw16uHZIb+PnUxQYWk+fkvEA/e53PySLy6H/haK2ld5rFKZLbRjmLk2Rh/JrvWko3DFA5mVQSHqt/gB0m4Rwm/LxTjUAXkeWTBMZP4ZkzGK3v0s87CbqOQN5GOg=="
package/CHANGELOG.md CHANGED
@@ -2,75 +2,153 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## 1.0.10 - 2025-03-04
6
+
7
+ [v1.0.9...1.0.10](../../compare/v1.0.9...1.0.10)
8
+
9
+ ### :rocket: New features
10
+
11
+ - *(xcode-artifacts)* :sparkles: remove iOS runtimes [<sup>(586155a)</sup>][586155a]
12
+
13
+ ### :bug: Bug fixes
14
+
15
+ - *(ruby-gems)* :bug: remove dry-run flag [<sup>(5525759)</sup>][5525759]
16
+ - *(android-sdk)* :bug: fix obsolete package delete [<sup>(60c184a)</sup>][60c184a]
17
+
18
+ ### :memo: Documentation
19
+
20
+ - *(infra)* :memo: fix changelog links [<sup>(a81eb4e)</sup>][a81eb4e]
21
+
22
+ ### :recycle: Refactor
23
+
24
+ - :recycle: main : separate module loading and execution [<sup>(496b562)</sup>][496b562]
25
+
26
+ ### :gear: Miscellaneous Tasks
27
+
28
+ - *(infra)* :memo: workaround git-cliff bug [<sup>(21e404c)</sup>][21e404c]
29
+ - *(infra)* :wrench: .env (encrypted): rotate GITHUB_TOKEN [<sup>(2582880)</sup>][2582880]
30
+
31
+ <!-- LINKS -->
32
+ [21e404c]:../../commit/21e404c3062b38ab03beec99b5a1cd35c54c9a49
33
+ [a81eb4e]:../../commit/a81eb4e5c3830d6b9ae01e07ce8f0a9d90e7b575
34
+ [2582880]:../../commit/2582880f7274c54c021d639f87c748a11996e204
35
+ [5525759]:../../commit/5525759d5fabda664b505f1721ddbf661a3b4ebd
36
+ [60c184a]:../../commit/60c184a8ccde88d9ee3a2e51ca9d8fd01877e03a
37
+ [586155a]:../../commit/586155aa21c63b79bf2f026d41f8ee24038852bd
38
+ [496b562]:../../commit/496b562e97e697ff41f68207b319996d8558c143
39
+
40
+ ## 1.0.9 - 2025-02-12
41
+
42
+ [v1.0.8...v1.0.9](../../compare/v1.0.8...v1.0.9)
43
+
44
+ ### :memo: Documentation
45
+
46
+ - *(infra)* :memo: reconfigure changelog format [<sup>(c005a80)</sup>][c005a80]
47
+
48
+ ### :gear: Miscellaneous Tasks
49
+
50
+ - *(infra)* :memo: reconfigure changelog format [<sup>(97967ac)</sup>][97967ac]
51
+
52
+ <!-- LINKS -->
53
+ [97967ac]:../../commit/97967ac83f415252769ee3a25294acd5677782df
54
+ [c005a80]:../../commit/c005a80f75a2794b58ccb207a86202c7d943f51b
55
+
5
56
  ## 1.0.8 - 2025-02-05
6
57
 
7
- [64546f9](64546f9fb87b06d86703311de819256761e2f7ad)...[e452923](e452923ade48217127cc9c786a6e12af2eab3829)
58
+ [v1.0.7...v1.0.8](../../compare/v1.0.7...v1.0.8)
59
+
60
+ ### :bug: Bug fixes
8
61
 
9
- ### Bug Fixes
62
+ - *(docker-files)* :bug: docker daemon detection [<sup>(24321d5)</sup>][24321d5]
63
+ - *(docker-files)* :bug: docker daemon detection [<sup>(6045125)</sup>][6045125]
64
+ - *(homebrew-caches)* :pencil2: typo [<sup>(720298f)</sup>][720298f]
65
+ - *(homebrew-caches)* :pencil2: typo [<sup>(e6620de)</sup>][e6620de]
66
+ - *(library-caches)* :bug: handle permissions issue [<sup>(7c56838)</sup>][7c56838]
67
+ - Revert "fix(homebrew-caches): :pencil2: typo"
68
+ - This reverts commit 720298fedd74c008c8b888d5169188a1aaca865b. [<sup>(6009b1f)</sup>][6009b1f]
10
69
 
11
- - :bug: docker daemon detection ([24321d5](24321d58fb062a28cacaa1fd809da5c37f7d6e79))
12
- - :bug: docker daemon detection ([6045125](604512591d2763cb5be4bc425b79d968c1697de6))
13
- - :pencil2: typo ([720298f](720298fedd74c008c8b888d5169188a1aaca865b))
14
- - :pencil2: typo ([e6620de](e6620deacacfbce8ae0292d208f4a1c2f3117aee))
15
- - :bug: handle permissions issue ([7c56838](7c56838eee1fa245bf81b040ac4ee4b17dbca9bb))
70
+ ### :memo: Documentation
16
71
 
17
- ### Documentation
72
+ - :memo: README - fix ref to changelog [<sup>(4bfc4a4)</sup>][4bfc4a4]
18
73
 
19
- - :memo: README - fix ref to changelog ([4bfc4a4](4bfc4a4f01631e5a1b6c49e71aefc918251845fc))
74
+ ### :gear: Miscellaneous Tasks
20
75
 
21
- ### Miscellaneous Tasks
76
+ - :construction_worker: release-it - auto-publish NPM module [<sup>(e452923)</sup>][e452923]
22
77
 
23
- - :construction_worker: release-it - auto-publish NPM module ([e452923](e452923ade48217127cc9c786a6e12af2eab3829))
78
+ <!-- LINKS -->
79
+ [4bfc4a4]:../../commit/4bfc4a4f01631e5a1b6c49e71aefc918251845fc
80
+ [24321d5]:../../commit/24321d58fb062a28cacaa1fd809da5c37f7d6e79
81
+ [6045125]:../../commit/604512591d2763cb5be4bc425b79d968c1697de6
82
+ [720298f]:../../commit/720298fedd74c008c8b888d5169188a1aaca865b
83
+ [6009b1f]:../../commit/6009b1f66a1eccd7c4ef842d5dd769b250d54c1a
84
+ [e6620de]:../../commit/e6620deacacfbce8ae0292d208f4a1c2f3117aee
85
+ [7c56838]:../../commit/7c56838eee1fa245bf81b040ac4ee4b17dbca9bb
86
+ [e452923]:../../commit/e452923ade48217127cc9c786a6e12af2eab3829
24
87
 
25
88
  ## 1.0.7 - 2025-02-05
26
89
 
27
- [88faf33](88faf333e35787b53a8988f8a42647e5fde4bfdc)...[30f323d](30f323da067b92b69f912cea5ce85b90997cef44)
90
+ [v1.0.6...v1.0.7](../../compare/v1.0.6...v1.0.7)
28
91
 
29
- ### Bug Fixes
92
+ ### :bug: Bug fixes
30
93
 
31
- - :recycle: try to detect brew location ([2aace79](2aace79ab5570049af7bfd87908cbfd4a5f9334f))
32
- - :bug: fix avdmanager path error ([9b28ba2](9b28ba2f4163454a5d36e48af93c3e51509a8b9c))
94
+ - *(homebrew-caches)* :recycle: try to detect brew location [<sup>(2aace79)</sup>][2aace79]
95
+ - *(android-avd)* :bug: fix avdmanager path error [<sup>(9b28ba2)</sup>][9b28ba2]
33
96
 
34
- ### Documentation
97
+ ### :memo: Documentation
35
98
 
36
- - :bookmark: fix changelog for previous version ([8792d75](8792d759de54c46be3cf3471a7ef3c18f937a41c))
99
+ - *(infra)* :bookmark: fix changelog for previous version [<sup>(8792d75)</sup>][8792d75]
37
100
 
38
- ### Miscellaneous Tasks
101
+ ### :gear: Miscellaneous Tasks
39
102
 
40
- - :construction_worker: fix changelog generation ([30f323d](30f323da067b92b69f912cea5ce85b90997cef44))
103
+ - :construction_worker: fix changelog generation [<sup>(30f323d)</sup>][30f323d]
104
+
105
+ <!-- LINKS -->
106
+ [8792d75]:../../commit/8792d759de54c46be3cf3471a7ef3c18f937a41c
107
+ [2aace79]:../../commit/2aace79ab5570049af7bfd87908cbfd4a5f9334f
108
+ [9b28ba2]:../../commit/9b28ba2f4163454a5d36e48af93c3e51509a8b9c
109
+ [30f323d]:../../commit/30f323da067b92b69f912cea5ce85b90997cef44
41
110
 
42
111
  ## 1.0.6 - 2024-12-09
43
112
 
44
- [462ee69](462ee6964edfa65a224b1cc56f1f7cc15fdc600a)...[88faf33](88faf333e35787b53a8988f8a42647e5fde4bfdc)
113
+ [v1.0.5...v1.0.6](../../compare/v1.0.5...v1.0.6)
114
+
115
+ ### :gear: Miscellaneous Tasks
45
116
 
46
- ### Miscellaneous Tasks
117
+ - :hammer: add GITHUB_TOKEN [<sup>(4d14cbf)</sup>][4d14cbf]
118
+ - :arrow_up: update dependency to node >= 18 [<sup>(ca92511)</sup>][ca92511]
47
119
 
48
- - :hammer: add GITHUB_TOKEN ([4d14cbf](4d14cbfae18980d645d60f10a7feef9ce7650b06))
49
- - :arrow_up: update dependency to node >= 18 ([ca92511](ca925115cb3137e795d55769dfa7332cf38b89cf))
50
- - Release 1.0.6 ([88faf33](88faf333e35787b53a8988f8a42647e5fde4bfdc))
120
+ <!-- LINKS -->
121
+ [4d14cbf]:../../commit/4d14cbfae18980d645d60f10a7feef9ce7650b06
122
+ [ca92511]:../../commit/ca925115cb3137e795d55769dfa7332cf38b89cf
51
123
 
52
124
  ## 1.0.5 - 2024-12-09
53
125
 
54
- [bc39b3e](bc39b3e006b19b68acd7deb3b30a8be93b50a52b)...[462ee69](462ee6964edfa65a224b1cc56f1f7cc15fdc600a)
126
+ [v1.0.4...v1.0.5](../../compare/v1.0.4...v1.0.5)
127
+
128
+ ### :rocket: New features
55
129
 
56
- ### Bug Fixes
130
+ - Add commit linting and release-it [<sup>(12729bd)</sup>][12729bd]
57
131
 
58
- - :bug: fix issue with android sdkmanager path ([6bb0ba6](6bb0ba6fcca63f56f44808eff220eda86579ce85))
132
+ ### :bug: Bug fixes
59
133
 
60
- ### Features
134
+ - *(android-sdk)* :bug: fix issue with android sdkmanager path [<sup>(6bb0ba6)</sup>][6bb0ba6]
61
135
 
62
- - Add commit linting and release-it ([12729bd](12729bd019abd9219e6cb3eeda040fc90e836228))
136
+ ### :gear: Miscellaneous Tasks
63
137
 
64
- ### Miscellaneous Tasks
138
+ - *(infra)* :hammer: add vscode conventional commit scopes [<sup>(84e7ca5)</sup>][84e7ca5]
139
+ - *(infra)* :hammer: add vscode conventional commit scopes [<sup>(5979eed)</sup>][5979eed]
140
+ - *(infra)* :hammer: add release-it config [<sup>(639b8bb)</sup>][639b8bb]
65
141
 
66
- - :hammer: add vscode conventional commit scopes ([84e7ca5](84e7ca516dccec2ea1a798859480fbd65e77b935))
67
- - :hammer: add vscode conventional commit scopes ([5979eed](5979eed216a65ef6faa733bf71d2a5f47ffb708b))
68
- - :hammer: add release-it config ([639b8bb](639b8bb2122be6c4d7a83267c516636458d1743c))
69
- - Release 1.0.5 ([462ee69](462ee6964edfa65a224b1cc56f1f7cc15fdc600a))
142
+ <!-- LINKS -->
143
+ [6bb0ba6]:../../commit/6bb0ba6fcca63f56f44808eff220eda86579ce85
144
+ [84e7ca5]:../../commit/84e7ca516dccec2ea1a798859480fbd65e77b935
145
+ [5979eed]:../../commit/5979eed216a65ef6faa733bf71d2a5f47ffb708b
146
+ [639b8bb]:../../commit/639b8bb2122be6c4d7a83267c516636458d1743c
147
+ [12729bd]:../../commit/12729bd019abd9219e6cb3eeda040fc90e836228
70
148
 
71
149
  ## 1.0.4 - 2024-10-03
72
150
 
73
- [d44b8c0](d44b8c0a12b30f9b4d8f15f89a1ee80150d147cd)...[bc39b3e](bc39b3e006b19b68acd7deb3b30a8be93b50a52b)
151
+ [v1.0.3...v1.0.4](../../compare/v1.0.3...v1.0.4)
74
152
 
75
153
  ## 1.0.3 - 2024-10-03
76
154
 
package/cliff.toml CHANGED
@@ -9,27 +9,46 @@ All notable changes to this project will be documented in this file.\n
9
9
  """
10
10
  # template for the changelog body
11
11
  # https://keats.github.io/tera/docs/#introduction
12
- body = """
12
+ body = """\
13
+ {% set orig_version = version %}\
13
14
  {% if version %}\
14
15
  ## {{ version | trim_start_matches(pat="v") }} - {{ timestamp | date(format="%Y-%m-%d") }}
15
16
  {% else %}\
16
17
  ## Unreleased
17
- {% endif %}\
18
+ {% endif %}{% raw %}\n{% endraw %}\
18
19
  {% if previous %}\
19
- {% if previous.commit_id and commit_id %}
20
- [{{ previous.commit_id | truncate(length=7, end="") }}]({{ previous.commit_id }})...\
21
- [{{ commit_id | truncate(length=7, end="") }}]({{ commit_id }})
20
+ {% if previous.version and version %}\
21
+ [{{ previous.version }}...{{ orig_version }}](../../compare/{{ previous.version }}...{{ orig_version }})
22
22
  {% endif %}\
23
23
  {% endif %}\
24
24
  {% for group, commits in commits | group_by(attribute="group") %}
25
- ### {{ group | upper_first }}
26
- {% for commit in commits %}
27
- - {{ commit.message | split(pat="\n") | first | upper_first | trim }} ([{{ commit.id | truncate(length=7, end="") }}]({{ commit.id }}))\
28
- {% for footer in commit.footers -%}
29
- , {{ footer.token }}{{ footer.separator }}{{ footer.value }}\
30
- {% endfor %}\
31
- {% endfor %}
32
- {% endfor %}\n
25
+ ### {{ group | striptags | trim | upper_first }}
26
+
27
+ {% for commit in commits
28
+ | filter(attribute="scope") %}\
29
+ {% set sha = commit.id | truncate(length=7, end="") %}\
30
+ {% set sanitized_message = commit.message | replace(from="\n\n", to="\n") | upper_first | trim | indent(prefix=" - ", first=false) %}\
31
+ - *({{commit.scope}})* {{ sanitized_message }} [<sup>({{ sha }})</sup>][{{ sha }}]
32
+ {%- if commit.breaking %}\
33
+ {% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description | indent(prefix=" - ", first=false)}}
34
+ {%- endif -%}{% raw %}\n{% endraw %}\
35
+ {%- endfor -%}\
36
+ {%- for commit in commits %}\
37
+ {% set sha = commit.id | truncate(length=7, end="") %}\
38
+ {% set sanitized_message = commit.message | replace(from="\n\n", to="\n") | upper_first | trim | indent(prefix=" - ", first=false) %}\
39
+ {%- if commit.scope -%}\
40
+ {% else -%}\
41
+ - {{ sanitized_message }} [<sup>({{ sha }})</sup>][{{ sha }}]
42
+ {% if commit.breaking -%}\
43
+ {% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description | indent(prefix=" - ", first=false)}}
44
+ {% endif -%}\
45
+ {% endif -%}\
46
+ {% endfor -%}\
47
+ {% endfor %}
48
+ <!-- LINKS -->
49
+ {% for commit in commits %}\
50
+ [{{ commit.id | truncate(length=7, end="") }}]:../../commit/{{ commit.id }}
51
+ {% endfor %}{% raw %}\n{% endraw %}
33
52
  """
34
53
  # template for the changelog footer
35
54
  footer = """
@@ -38,6 +57,7 @@ footer = """
38
57
  # remove the leading and trailing whitespace from the templates
39
58
  trim = true
40
59
 
60
+
41
61
  [git]
42
62
  # parse the commits based on https://www.conventionalcommits.org
43
63
  conventional_commits = true
@@ -45,23 +65,20 @@ conventional_commits = true
45
65
  filter_unconventional = false
46
66
  # regex for parsing and grouping commits
47
67
  commit_parsers = [
48
- { message = "^feat", group = "Features" },
49
- { message = "^fix", group = "Bug Fixes" },
50
- { message = "^doc", group = "Documentation" },
51
- { message = "^perf", group = "Performance" },
52
- { message = "^refactor", group = "Refactor" },
53
- { message = "^style", group = "Styling" },
54
- { message = "^test", group = "Testing" },
55
- { message = "^chore\\(deps.*\\)", skip = true },
56
- { message = "^chore\\(pr\\)", skip = true },
57
- { message = "^chore\\(pull\\)", skip = true },
58
- { message = "^chore\\(release\\): prepare for", skip = true },
59
- { message = "^chore|^ci", group = "Miscellaneous Tasks" },
60
- { body = ".*security", group = "Security" },
68
+ { message = "^(feat|Revert \"feat)", group = "<!-- 0 -->:rocket: New features" },
69
+ { message = "^(fix|Revert \"fix)", group = "<!-- 1 -->:bug: Bug fixes" },
70
+ { message = "^(doc|Revert \"doc)", group = "<!-- 2 -->:memo: Documentation" },
71
+ { message = "^(perf|Revert \"perf)", group = "<!-- 3 -->:zap: Performance" },
72
+ { message = "^(refactor|Revert \"refactor)", group = "<!-- 4 -->:recycle: Refactor" },
73
+ { message = "^(style|Revert \"style)", group = "<!-- 5 -->:lipstick: Styling" },
74
+ { message = "^(test|Revert \"test)", group = "<!-- 6 -->:test_tube: Testing" },
75
+ { message = "^(chore|Revert \"chore)\\(release\\): prepare for", skip = true },
76
+ { message = "^(chore|Revert \"chore)|^(ci|Revert \"ci)", group = "<!-- 7 -->:gear: Miscellaneous Tasks" },
77
+ { body = ".*security", group = "<!-- 8 -->:lock: Security" },
61
78
  ]
62
79
  # filter out the commits that are not matched by commit parsers
63
80
  filter_commits = false
64
81
  # sort the tags topologically
65
82
  topo_order = false
66
83
  # sort the commits inside sections by oldest/newest order
67
- sort_commits = "oldest"
84
+ sort_commits = "oldest"
@@ -133,58 +133,67 @@ source "${DIR}/modules/hints.sh"
133
133
 
134
134
  # CocoaPods
135
135
  source "${DIR}/modules/cocoapods.sh"
136
- cocoapods
137
136
 
138
137
  # remove everything in ~/Library/Caches
139
138
  source "${DIR}/modules/library-caches.sh"
140
- libraryCaches
141
139
 
142
140
  # remove everything from Trash - this sometimes prompts for confirmation
143
141
  source "${DIR}/modules/trash.sh"
144
- trash
145
142
 
146
143
  # meteor
147
144
  source "${DIR}/modules/meteor-builds-and-packages.sh"
148
- meteorBuildsAndPackages
149
145
 
150
146
  # npm cache
151
147
  source "${DIR}/modules/npm-cache.sh"
152
- npmCache
153
148
 
154
149
  # yarn cache
155
150
  source "${DIR}/modules/yarn-cache.sh"
156
- yarnCache
157
151
 
158
152
  # bun cache
159
153
  source "${DIR}/modules/bun-cache.sh"
160
- bunCache
161
154
 
162
155
  # ### XCode ###
163
156
  source "${DIR}/modules/xcode-artifacts.sh"
164
- xcodeArtifacts
165
157
 
166
158
  # Clear shared gradle caches
167
159
  source "${DIR}/modules/gradle-shared.sh"
168
- gradleShared
169
160
 
170
161
  # node_modules folders
171
162
  source "${DIR}/modules/node-modules.sh"
172
- nodeModules
173
163
 
174
164
  # ruby gems
175
165
  source "${DIR}/modules/ruby-gems.sh"
176
- rubyGems
177
166
 
178
167
  # Docker
179
168
  source "${DIR}/modules/docker-files.sh"
180
- dockerFiles
181
169
 
182
170
  # Android projects - remove build folders
183
171
  source "${DIR}/modules/android-build-folders.sh"
184
- androidBuildFolders
185
172
 
186
173
  # Android SDKs
187
174
  source "${DIR}/modules/android-sdk.sh"
175
+
176
+ # Android AVDs
177
+ source "${DIR}/modules/android-avd.sh"
178
+
179
+ # Homebrew Caches
180
+ source "${DIR}/modules/homebrew-caches.sh"
181
+
182
+ # ======
183
+ # Now run all our modules
184
+ cocoapods
185
+ libraryCaches
186
+ trash
187
+ meteorBuildsAndPackages
188
+ npmCache
189
+ yarnCache
190
+ bunCache
191
+ xcodeArtifacts
192
+ gradleShared
193
+ nodeModules
194
+ rubyGems
195
+ dockerFiles
196
+ androidBuildFolders
188
197
  set +e ; # don't exit on error
189
198
  androidSDK
190
199
  RETCODE=$?
@@ -199,13 +208,7 @@ if [ ${RETCODE} -ne 0 ]; then
199
208
  exit ${RETCODE}
200
209
  fi
201
210
  fi
202
-
203
- # Android AVDs
204
- source "${DIR}/modules/android-avd.sh"
205
211
  androidAVD
206
-
207
- # Homebrew Caches
208
- source "${DIR}/modules/homebrew-caches.sh"
209
212
  homebrewCaches
210
213
 
211
214
  # get the disk usage now that we've run the cleanup
@@ -61,39 +61,51 @@ BEGIN{
61
61
  }
62
62
  lastPath="";
63
63
  lastCat="";
64
+ processedHeading=0;
64
65
  delete itemsToRemove[0]; # initializes a new array
65
66
  itemsToRemoveLength=0; # length of array
66
67
  }
67
68
  /Installed packages:/{
68
69
  inInstalled=1;
69
70
  inObsolete=0;
71
+ processedHeading=0;
70
72
  }
71
73
  /Installed Obsolete Packages:/{
72
74
  inInstalled=0;
73
75
  inObsolete=1;
76
+ processedHeading=0;
74
77
  }
75
- /\;/{
76
- path=$1;
77
- version=$3;
78
- loc=$NF; # last field is location; description has spaces to hard to grab
79
- cat=path;
80
- gsub(/;.+$/,"",cat); # the category is just the first portion of the path before the semicolon e.g. "platforms"
81
- if (inInstalled) {
82
- # If this category is the same as the last one, add the
83
- # previous record to our list of ones to remove (and keep only the most recent).
84
- if (cat == lastCat) {
85
- # add the last category as a new item on the end of our array
78
+ $7 ~ /^-------/ { # this is the end of a heading; move to the next line
79
+ processedHeading=1;
80
+ next;
81
+ }
82
+ $0 ~ /^.+$/ { # non-empty line
83
+ if (processedHeading == 1) {
84
+ path=$1;
85
+ version=$3;
86
+ loc=$NF; # last field is location; description has spaces to hard to grab
87
+ cat=path;
88
+ gsub(/;.+$/,"",cat); # the category is just the first portion of the path before the semicolon e.g. "platforms"
89
+
90
+ if (inInstalled) {
91
+ # If this category is the same as the last one, add the
92
+ # previous record to our list of ones to remove (and keep only the most recent).
93
+ if (cat == lastCat) {
94
+ # add the last category as a new item on the end of our array
95
+ printf("Adding least-recent\"%s\" to itemsToRemove (superceded by \"%s\")\n", lastPath, path);
96
+ itemsToRemoveLength++;
97
+ itemsToRemove[itemsToRemoveLength] = lastPath;
98
+ } else {
99
+ # we're in a category we haven't yet seen (or the output is not sorted and everything will fall apart)
100
+ }
101
+ lastCat = cat;
102
+ lastPath = path;
103
+ } else if (inObsolete) {
104
+ printf("Obsolete: Adding \"%s\" to itemsToRemove\n", path);
105
+ # we'll just add all obsolete packages to the list of items to remove
86
106
  itemsToRemoveLength++;
87
- itemsToRemove[itemsToRemoveLength] = lastPath;
88
- } else {
89
- # we're in a new category
107
+ itemsToRemove[itemsToRemoveLength] = path;
90
108
  }
91
- lastCat = cat;
92
- lastPath = path;
93
- } else if (inObsolete) {
94
- # we'll just add all obsolete packages to the list of items to remove
95
- itemsToRemoveLength++;
96
- itemsToRemove[itemsToRemoveLength] = path;
97
109
  }
98
110
  }
99
111
  END{
@@ -19,7 +19,7 @@ rubyGems() {
19
19
  done
20
20
  unset IFS
21
21
  # remove gems
22
- gem cleanup -d
22
+ gem cleanup
23
23
  }
24
24
  }
25
25
 
@@ -41,5 +41,12 @@ xcodeArtifacts() {
41
41
  echo "${DEVICESUPPORTCOMMAND}"
42
42
  addHint "${DEVICESUPPORTCOMMAND}"
43
43
  fi
44
+
45
+ echo " removing unavailable simulator devices..."
46
+ xcrun simctl delete unavailable
47
+
48
+ echo " removing all but the most recent iOS simulator runtime..."
49
+ xcrun simctl runtime list | grep -E '^iOS' | sort -r -n -k 2 | awk 'NR>1{print $5}' | xargs -I{} xcrun simctl runtime delete {}
50
+
44
51
  fi # xcode
45
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mikes-macos-developer-disk-cleanup",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
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"