Crash if system directory does not exist
The system directory should not be needed to add user fonts, but it is:
Error: unable to access system fonts: failed to ensure system font directory exists: mkdir /usr/local/share/fonts: permission denied
@polazarus On Linux, user installs land in your home (typically ~/.local/share/fonts). Machine installs use system dirs like /usr/local/share/fonts.
If you run sudo fontget add <font-id>it will automatically default to installing as a machine install. If you only want your user folder: run without sudo, or use sudo fontget add <font-id> --scope user.
I added a short note about this in docs/usage.md for future reference either way
Honestly your error text is a bit odd for what I’d expect from current Linux builds (and if it really ran as root, permission denied on mkdir under /usr/local/share/fonts is unusual unless the filesystem is locked down or something else is off).
I'd need more info about your setup and what you ran to track this down further. Can you send:
- Your
fontget version, - The exact command you ran, and copy paste the full output with
--debug(e.g.fontget add <font-id> --scope user --debug
My point is that without sudo and with the --user flag it still tries to run a mkdir on /usr if the system directory does not exist.
Perfect thank you. I've fixed this in the codebase and it will go out in the next release which will be coming soon.