From 3350f6791325144dd190dcda8cf45b728b3c929d Mon Sep 17 00:00:00 2001 From: Anders Nygard Date: Sun, 11 Oct 2015 12:06:33 +0200 Subject: [PATCH 1/2] Addded a font selection option --- install.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index a18a7fc..0432eb9 100755 --- a/install.sh +++ b/install.sh @@ -3,7 +3,13 @@ # Set source and target directories powerline_fonts_dir=$( cd "$( dirname "$0" )" && pwd ) -find_command="find \"$powerline_fonts_dir\" \( -name '*.[o,t]tf' -or -name '*.pcf.gz' \) -type f -print0" +# if an argument is given it is used to select wich fonts to install +prefix='' +if [ $# = 1 ]; then + prefix=$1 +fi + +find_command="find \"$powerline_fonts_dir\" \( -name '$prefix*.[o,t]tf' -or -name '$prefix*.pcf.gz' \) -type f -print0" if [[ `uname` == 'Darwin' ]]; then # MacOS @@ -22,4 +28,4 @@ if [[ -n `which fc-cache` ]]; then fc-cache -f $font_dir fi -echo "All Powerline fonts installed to $font_dir" +echo "Powerline fonts installed to $font_dir" From 91aae1698aa6f3e60878d8cfdcf8eda66f705181 Mon Sep 17 00:00:00 2001 From: ZyX Date: Wed, 22 Mar 2017 01:36:48 +0300 Subject: [PATCH 2/2] Do not check $# If no argument is given then `"$1"` is an empty string, so no need to bother. --- install.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 0432eb9..403c797 100755 --- a/install.sh +++ b/install.sh @@ -4,10 +4,7 @@ powerline_fonts_dir=$( cd "$( dirname "$0" )" && pwd ) # if an argument is given it is used to select wich fonts to install -prefix='' -if [ $# = 1 ]; then - prefix=$1 -fi +prefix="$1" find_command="find \"$powerline_fonts_dir\" \( -name '$prefix*.[o,t]tf' -or -name '$prefix*.pcf.gz' \) -type f -print0"