awesome-terminal-fonts
awesome-terminal-fonts copied to clipboard
Cannot stat ./.work/octicons-regular-relocated.ttf
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)
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.