Skip to content

Exit Codes

Fontist uses standard exit codes to indicate the result of command execution.

CodeNameDescription
0SUCCESSCommand completed successfully
1UNKNOWN_ERRORUnknown or unexpected error
2NON_SUPPORTED_FONT_ERRORFont is not supported by fontist
3MISSING_FONT_ERRORFont could not be found on the system or in formulas
4LICENSING_ERRORLicense agreement required but not accepted
5MANIFEST_COULD_NOT_BE_FOUND_ERRORManifest file not found at specified path
6MANIFEST_COULD_NOT_BE_READ_ERRORManifest file could not be read (invalid YAML or permissions)
7FONT_INDEX_CORRUPTEDFont index file is corrupted and needs to be rebuilt
8REPO_NOT_FOUNDRepository not found
9MAIN_REPO_NOT_FOUNDMain formulas repository not found
10REPO_COULD_NOT_BE_UPDATEDRepository could not be updated (network or git error)
11MANUAL_FONT_ERRORManual font installation required (font cannot be downloaded)
12SIZE_LIMIT_ERRORFormula exceeds size limit. Use --size-limit, --newest, or --smallest options
13FORMULA_NOT_FOUNDFormula not found for the requested font
14FONTCONFIG_NOT_FOUNDFontconfig is not installed or not found
15FONTCONFIG_FILE_NOT_FOUNDFontconfig configuration file not found
16INVALID_CONFIG_ATTRIBUTEInvalid configuration attribute specified

Using Exit Codes in Scripts

Exit codes are useful for scripting and CI/CD:

sh
#!/bin/bash
fontist install "Roboto"
if [ $? -eq 4 ]; then
  echo "License acceptance required"
  fontist install "Roboto" --accept-all-licenses
fi

Common Patterns

CI/CD Pipelines

yaml
# GitHub Actions example
- name: Install fonts
  run: |
    fontist install --accept-all-licenses --hide-licenses
    # Check for missing fonts
    if [ $? -eq 3 ]; then
      echo "Some fonts not found"
      exit 1
    fi

Error Handling

ruby
# Ruby script example
result = system("fontist install 'Roboto'")
case $?.exitstatus
when 0
  puts "Success"
when 3
  puts "Font not found"
when 4
  puts "License needs acceptance"
else
  puts "Unknown error"
end

Fontist is riboseopen