Add fontconfig to debian apt deps, make fc-cache non-fatal
Discovered on crouton bootstrap: a fresh debian install may not have fontconfig installed, so fc-cache is missing. The script's font install step crashed at fc-cache, aborting the rest of the bootstrap (cargo install bat never ran). Fixes: 1. Add fontconfig to APT_PKGS so fc-cache and fc-list are present on debian from the start (matches what's typically pre-installed on most desktop distros but not on minimal server installs) 2. Wrap fc-cache in 'command -v' guard so if the package somehow isn't installed, the script logs a warning and continues instead of aborting the whole chain
This commit is contained in:
parent
a6582de626
commit
ddf2ca4da1
1 changed files with 7 additions and 2 deletions
|
|
@ -49,6 +49,7 @@ APT_PKGS=(
|
|||
unzip p7zip
|
||||
openssh-client
|
||||
ca-certificates curl wget
|
||||
fontconfig
|
||||
)
|
||||
|
||||
log "installing apt packages"
|
||||
|
|
@ -177,8 +178,12 @@ else
|
|||
log "extracting font files"
|
||||
unzip -q -o "$TMP_ZIP" -d "$FONT_DIR"
|
||||
rm -f "$TMP_ZIP"
|
||||
log "running fc-cache"
|
||||
fc-cache -fv >/dev/null
|
||||
log "refreshing font cache (fc-cache)"
|
||||
if command -v fc-cache >/dev/null 2>&1; then
|
||||
fc-cache -fv >/dev/null
|
||||
else
|
||||
log "WARNING: fc-cache not found — install fontconfig package"
|
||||
fi
|
||||
else
|
||||
log "WARNING: failed to download Maple Mono NF — nvim will warn about missing font"
|
||||
log "manual install: https://github.com/subframe7536/Maple-font"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue