Skip to content

Commit

Permalink
fixed install.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ialokim committed Jan 2, 2018
1 parent 0f3f47a commit 74dad88
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#!/bin/bash

# Set source and target directories
powerline_fonts_dir=$( cd "$( dirname "$0" )" && pwd )
powerline_fonts_dir="$( cd "$( dirname "$0" )" && pwd )"

# if an argument is given it is used to select which fonts to install
prefix="$1"

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

if [[ `uname` == 'Darwin' ]]; then
if test "$(uname)" = "Darwin" ; then
# MacOS
font_dir="$HOME/Library/Fonts"
else
Expand All @@ -19,12 +17,12 @@ fi

# Copy all fonts to user fonts directory
echo "Copying fonts..."
eval $find_command | xargs -0 -n1 -I % cp "%" "$font_dir/"
find "$powerline_fonts_dir" \( -name "$prefix*.[ot]tf" -or -name "$prefix*.pcf.gz" \) -type f -print0 | xargs -0 -n1 -I % cp "%" "$font_dir/"

# Reset font cache on Linux
if command -v fc-cache @>/dev/null ; then
if which fc-cache >/dev/null 2>&1 ; then
echo "Resetting font cache, this may take a moment..."
fc-cache -f $font_dir
fc-cache -f "$font_dir"
fi

echo "Powerline fonts installed to $font_dir"

0 comments on commit 74dad88

Please sign in to comment.