gabrielelana / awesome-terminal-fonts

Tools and instructions on how to have awesome symbols in a terminal with a monospace font
MIT License
2.44k stars 231 forks source link

Cannot stat ./.work/octicons-regular-relocated.ttf #34

Open jep-dev opened 7 years ago

jep-dev commented 7 years ago

fu-relocate is redirected 2>/dev/null so any failure is displaced to the next dependent line, in this case build.sh:13 (fu-relocate ...) to build.sh:14 (cp ...).

Appending || { echo "Failed for ..." && exit 1 } to each command shows me that the first invocation of fu-relocate failed... and removing the redirection to /dev/null shows that I was missing FontForge.

Possible fixes:

which fontforge >/dev/null || echo "Missing FontForge" && exit 1 (most portable?)

[ -x /usr/bin/fontforge ] || echo "Missing FontForge" && exit 1 (depends on location)

dpkg -l | grep fontforge || echo "Missing FontForge" && exit 1 (depends on dpkg)

jep-dev commented 7 years ago

As a general rule, when one command requires the success of another, I chain them with '&&'. There's a time and a place for redirection to /dev/null, like my use of which, but silencing errors on critical sections and carrying on seems like a mistake. If the user wants to silence it, they can either set up the redirect at the top-level invocation of build.sh, or you can give them a --silent/--quiet option to do it for them.