Skip to content

Commit

Permalink
Support selecting fonts without a file extension
Browse files Browse the repository at this point in the history
  • Loading branch information
stuarthayhurst committed Oct 31, 2020
1 parent f88962b commit 1349dcb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,13 @@ getFontFile() {
fi

if [[ ! -f "$fontfile" ]]; then
if [[ ! -f "fonts/${fontfile}" ]]; then
if [[ -f "fonts/${fontfile}" ]]; then
fontfile="$fontfile"
elif [[ -f "fonts/${fontfile}.ttf" ]]; then
fontfile="$fontfile".ttf
elif [[ -f "fonts/${fontfile}.ttf" ]]; then
fontfile="$fontfile".otf
else
output "error" "Invalid fontfile, use './install.sh -f' to view available fonts"
exit 1
fi
Expand Down

0 comments on commit 1349dcb

Please sign in to comment.