directories icon indicating copy to clipboard operation
directories copied to clipboard

Windows config_dir

Open jonahbeckford opened this issue 11 months ago • 3 comments

Is there any reason that the Roaming %AppData% is chosen as the config_dir in the following https://github.com/OCamlPro/directories/blob/1cf7211f918fa909e5f77c0dfbb059c74071e99b/src/windows/directories.ml#L36-L37

I've commonly seen XDG_CONFIG_HOME mapped to %LocalAppData%, like in https://docs.racket-lang.org/basedir/index.html . Either way makes sense (I'm not objecting), but since I'm evaluating making this package the standard for the DkML Windows distribution (once #14 is addressed) I'd love to understand.

jonahbeckford avatar Jul 08 '23 01:07 jonahbeckford

Forgot that the other active XDG library (https://v3.ocaml.org/p/xdg/latest) uses LocalAppData in https://github.com/ocaml/dune/blob/8f7bcffb1f797bf2d240430d1be09be462654857/otherlibs/xdg/xdg.ml#L38-L40 :

let config_dir t =
  let home = t.home_dir in
  make t "XDG_CONFIG_HOME" (home / ".config") LocalAppData

So it would be good to harmonize!

jonahbeckford avatar Jul 08 '23 02:07 jonahbeckford

Hi @jonahbeckford

IIRC, I followed what was done in directories-rs and directories-jvm.

It seems a config_local_dir was recently added to directories-rs.

I'm not sure which (roaming/local) is best for the default config dir but I would say roaming as it's usually files one would want to keep in sync (at least that's what I usually do personally on linux: my dotfiles are all sync'ed).

I'm not against doing the same thing as in directories-rs (i.e. adding a local config dir, and having it to point to config_dir on linux/macOS). If you're interested enough to do a PR, I'll merge it. ;)

zapashcanon avatar Jul 17 '23 16:07 zapashcanon

Oh config_local_dir would be good. When I swing back this way (it will be a while) I'll look at doing a PR.

jonahbeckford avatar Jul 19 '23 01:07 jonahbeckford