-
Notifications
You must be signed in to change notification settings - Fork 20
/
hgrmjunk
executable file
·66 lines (64 loc) · 1.03 KB
/
hgrmjunk
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/sh
# ~/bin/hgrmjunk
# Delete files that are generally not useful for spellchecking
find * -type d -name vendor -print0 \
| xargs -0 hg rm 2>/dev/null >/dev/null
hg files 'set:symlink()' -0|xargs -0 hg rm
SPECS="
'*.ai'
'*.bmp'
'*.cer'
'*.class'
'*.crl'
'*.crt'
'*.csr'
'*.dll'
'*.eot'
'*.eps'
'*.exe'
'*.gif'
'*.graffle'
'*.gz'
'*.icns'
'*.ico'
'*.jar'
'*.jpeg'
'*.jpg'
'*.key'
'*.lock'
'*.lib'
'*.map'
'*.min.*'
'*.mp3'
'*.mp4'
'*.otf'
'*.pdf'
'*.pem'
'*.png'
'*.psd'
'*.sig'
'*.so'
'*SUMS'
'*.svg'
'*.svgz'
'*.tar'
'*.tgz'
'*.ttf'
'*.woff*'
'*.xcf'
'*.xls*'
'*.xpm'
'*.yml'
'*.zip'
.DS_Store
go.sum
go.mod
package-lock.json
"
hg locate -0 \
$(for a in $SPECS; do eval echo "$a" | perl -pne 'next unless /\*/; s/([.])/\\$1/g; s/([*])/.*/g; s/(^.*$)/re:(?i)^$1\$/'; done) \
| xargs -0 hg rm 2>&1|uniq
hg locate -0 \
| xargs -0 grep --null -s -l data: | xargs -0 r 's{"data:[a-zA-Z=;,/0-9+]+"}{"data:,"}g;'"s{'data:[a-zA-Z=;,/0-9+]+'}{'data:,'};"
hg locate -0 \
| xargs -0 grep --null -s -l 0x | xargs -0 r 's/0x[a-f0-9A-F]{2,}[Uu]?[Ll]?/0xFF/g'