This repository has been archived by the owner on Sep 29, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cascadia_patcher.sh
executable file
·51 lines (51 loc) · 1.72 KB
/
cascadia_patcher.sh
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
#!/bin/bash
CASCADIAVERS=`curl -L 'https://github.com/microsoft/cascadia-code/releases/latest' | grep CascadiaCode | sed 's!\(.*/microsoft/cascadia-code/releases/download/\([^"]*\).*\|.*span.*\)!\2!'`
echo Downloading ${CASCADIAVERS}
curl -L https://github.com/microsoft/cascadia-code/releases/download/${CASCADIAVERS} -O
unzip CascadiaCode*.zip
rm -rf otf
rm -rf woff2
rm CascadiaCode*.zip
mkdir ttf/variable
mv ttf/*PL*.ttf ttf/variable
cd ttf/static
mkdir -p {mono,dynamic}/patched
mv CascadiaMonoPL* mono/
mv CascadiaCodePL* dynamic/
rm Cascadia*
docker run --rm -v ${PWD}/dynamic:/in -v ${PWD}/dynamic/patched:/out nerdfonts/patcher -c --careful
docker run --rm -v ${PWD}/mono:/in -v ${PWD}/mono/patched:/out nerdfonts/patcher -c -s --careful
# /usr/bin/env ruby <<-EORUBY
# Dir.glob("dynamic/patched/*.ttf") do |f|
# File.rename(f, f.gsub(' ', '').sub('CaskaydiaCovePL', 'CascadiaCodePL-').sub('NerdFontComplete', ''))
# end
# Dir.glob("mono/patched/*.ttf") do |f|
# File.rename(f, f.gsub(' ', '').sub('PL', 'PL-').sub('NerdFontCompleteMono', ''))
# end
# EORUBY
for f in dynamic/patched/*.ttf
do
new_file=${f// }
new_file=${new_file/CaskaydiaCovePL/Kascadia-}
new_file=${new_file/NerdFontComplete/}
mv "$f" "$new_file"
done
for f in mono/patched/*.ttf
do
new_file=${f// }
new_file=${new_file/CascadiaMonoPL/KascadiaMono-}
new_file=${new_file/NerdFontCompleteMono/}
mv "$f" "$new_file"
done
cd ../..
for f in ttf/variable/*.ttf
do
new_file=${f/CascadiaCodePL/Kascadia}
new_file=${new_file/CascadiaMonoPL/KascadiaMono}
mv "$f" "$new_file"
done
mkdir fonts
mv ttf/variable/* fonts/
mv ttf/static/*/patched/* fonts/
filename=(${CASCADIAVERS#v*/})
zip Kascadia-$1.zip fonts/*