-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·43 lines (32 loc) · 1.04 KB
/
setup.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
#!/bin/bash
## Download and install Apple's latest fonts on macOS
# Set the working directory
cd /tmp
# Set the base URL
baseURL="https://devimages-cdn.apple.com/design/resources/download/"
# Set the font image names
fontImages=("SF-Pro.dmg" "SF-Compact.dmg" "SF-Mono.dmg" "NY.dmg")
# Set the font mounted volume names
fontVolumes=("SFProFonts" "SFCompactFonts" "SFMonoFonts" "NYFonts")
# Set the font package names
fontPackages=("SF Pro Fonts.pkg" "SF Compact Fonts.pkg" "SF Mono Fonts.pkg" "NY Fonts.pkg")
# Download the font images
for image in "${fontImages[@]}"; do
curl -O "${baseURL}${image}"
done
# Mount the font images
for image in "${fontImages[@]}"; do
hdiutil attach "${image}"
done
# Silently run the installer for each font package
for i in "${!fontVolumes[@]}"; do
sudo installer -pkg "/Volumes/${fontVolumes[$i]}/${fontPackages[$i]}" -target /
done
# Unmount the font volumes
for volume in "${fontVolumes[@]}"; do
hdiutil detach "/Volumes/${volume}"
done
# Remove the font images
for image in "${fontImages[@]}"; do
rm "${image}"
done