aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Singleton <matt@xcolour.net>2022-02-28 15:49:39 -0600
committerMatt Singleton <matt@xcolour.net>2022-02-28 15:49:39 -0600
commit0be4e649f873b7df90f9e111c1004f4e3738d79a (patch)
tree4c9b37721fa081a0c513904a41d5aa4310750c9b
parent91cb942849e5e272a4306071173330f6f2013096 (diff)
only download fonts if fc-cache is installed
-rwxr-xr-xdeploy.sh56
1 files changed, 29 insertions, 27 deletions
diff --git a/deploy.sh b/deploy.sh
index a9ca903..1e7f273 100755
--- a/deploy.sh
+++ b/deploy.sh
@@ -92,32 +92,34 @@ if [ ! -e "$dconfig/excludes" ]; then
fi
# download nerdfonts
-new_font=0
-function get_font {
- local font_name="$1"
- local font_url="$2"
- shift 2
- local font_dir="$HOME/.local/share/fonts/$font_name"
- mkdir -p "$font_dir"
- if [ ! -d "$font_dir" ] || [ -z "$(ls -A "$font_dir" 2> /dev/null)" ]; then
- $DLCMD "$font_dir/font.zip" "$font_url"
- $UNZIPCMD "$font_dir/font.zip" "$@" -d "$font_dir"
- rm "$font_dir/font.zip"
- new_font=1
+if command -v fc-cache > /dev/null; then
+ new_font=0
+ function get_font {
+ local font_name="$1"
+ local font_url="$2"
+ shift 2
+ local font_dir="$HOME/.local/share/fonts/$font_name"
+ mkdir -p "$font_dir"
+ if [ ! -d "$font_dir" ] || [ -z "$(ls -A "$font_dir" 2> /dev/null)" ]; then
+ $DLCMD "$font_dir/font.zip" "$font_url"
+ $UNZIPCMD "$font_dir/font.zip" "$@" -d "$font_dir"
+ rm "$font_dir/font.zip"
+ new_font=1
+ fi
+ }
+ get_font sourcecodepro-nerd \
+ https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/SourceCodePro.zip \
+ "Sauce Code Pro Medium Nerd Font Complete.ttf" \
+ "Sauce Code Pro Bold Nerd Font Complete.ttf" \
+ "Sauce Code Pro Medium Italic Nerd Font Complete.ttf" \
+ "Sauce Code Pro Bold Italic Nerd Font Complete.ttf"
+ get_font jetbrainsmono-nerd \
+ https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/JetBrainsMono.zip \
+ "JetBrains Mono Regular Nerd Font Complete Mono.ttf" \
+ "JetBrains Mono Italic Nerd Font Complete Mono.ttf" \
+ "JetBrains Mono Bold Nerd Font Complete Mono.ttf" \
+ "JetBrains Mono Bold Italic Nerd Font Complete Mono.ttf"
+ if [ "$new_font" = "1" ]; then
+ echo "Hint: Run 'fc-cache -v' to rebuild your font cache"
fi
-}
-get_font sourcecodepro-nerd \
- https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/SourceCodePro.zip \
- "Sauce Code Pro Medium Nerd Font Complete.ttf" \
- "Sauce Code Pro Bold Nerd Font Complete.ttf" \
- "Sauce Code Pro Medium Italic Nerd Font Complete.ttf" \
- "Sauce Code Pro Bold Italic Nerd Font Complete.ttf"
-get_font jetbrainsmono-nerd \
- https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/JetBrainsMono.zip \
- "JetBrains Mono Regular Nerd Font Complete Mono.ttf" \
- "JetBrains Mono Italic Nerd Font Complete Mono.ttf" \
- "JetBrains Mono Bold Nerd Font Complete Mono.ttf" \
- "JetBrains Mono Bold Italic Nerd Font Complete Mono.ttf"
-if [ "$new_font" = "1" ]; then
- echo "Hint: Run 'fc-cache -v' to rebuild your font cache"
fi