FontGet icon indicating copy to clipboard operation
FontGet copied to clipboard

Crash if system directory does not exist

Open polazarus opened this issue 7 months ago • 3 comments

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 avatar Apr 28 '26 12:04 polazarus

@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:

  1. Your fontget version,
  2. The exact command you ran, and copy paste the full output with --debug (e.g. fontget add <font-id> --scope user --debug

Graphixa avatar May 01 '26 03:05 Graphixa

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.

polazarus avatar May 01 '26 08:05 polazarus

Perfect thank you. I've fixed this in the codebase and it will go out in the next release which will be coming soon.

Graphixa avatar May 02 '26 02:05 Graphixa