Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow a single font-family to be installed #82

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@
# Set source and target directories
powerline_fonts_dir="${PWD}/patched-fonts"

# Accept a font / directory name, to avoid installing all fonts
if [ ! -z "$1" ];
then
# Ensure thar directory exists, and offer suggestions if not

if [[ ! -d "$powerline_fonts_dir/$1" ]];
then
echo -e "That font directory doesn't exist. Options are: \n"
ls "$powerline_fonts_dir"
exit -1
fi

powerline_fonts_dir="$powerline_fonts_dir/$1"
fi

find_command="find \"$powerline_fonts_dir\" \( -name '*.[o,t]tf' -or -name '*.pcf.gz' \) -type f -print0"

if [[ $(uname) == 'Darwin' ]]; then
Expand All @@ -22,4 +37,9 @@ if [[ -n $(which fc-cache) ]]; then
fc-cache -f "$font_dir"
fi

echo "All fonts installed to $font_dir"
if [ ! -z "$1" ];
then
echo "$1 font installed to $font_dir"
else
echo "All fonts installed to $font_dir"
fi
8 changes: 8 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,18 @@ Installs all of the patched Fonts (_Warning: This is a lot of Fonts adding up to

* Linux & Mac OS X

To install all fonts:
```sh
./install.sh
```

To install a single font:
```sh
./install.sh <FontName>
./install.sh Hack
./install.sh HeavyData
```

#### Examples

./install.sh
Expand Down