fsouza/prettierd

prettierd hangs on first run if it doesn't have write permissions for $HOME

heygarrett opened this issue · 3 comments

I've removed write permissions for my home directory to prevent it from getting littered with dot files. It took me a while to figure out that prettierd was trying to create .prettierd in my home directory rather than using ~/.config. It would be great if prettierd could follow the XDG base directory spec.

@heygarrett, if you have XDG_RUNTIME_DIR defined, prettierd uses it. Perhaps we can work with core_d to add a warning when that environment variable isn't defined, as the XDG base directory spec recommends.

Thanks for the clarification. I misunderstood the requirement, so apologies for filing a misinformed issue. It would be great to have a warning rather than having the process become unresponsive.

Yeah, I think we should:

  1. warn if $XDG_RUNTIME_DIR isn't set, in the warning we include information about what fallback is being used
  2. separately, if prettierd can't write to $HOME (or $XDG_RUNTIME_DIR), it shouldn't hang, but instead it should fail with a useful error message