Open zapashcanon opened 3 years ago
Please don't add external dependencies to ocp-indent
if it can be helped at all. They complicate using it in non-opam
situations.
- on macOS,
$HOME/Library/Application Support/com.OCamlPro.ocp-indent/config
Configurations for unix cli tool are perfectly fine according to xdg on macOS, for one thing that's where git
puts its stuff and having it in .config
makes it easy to sync over different unix
machines.
I don't mind if you also want to too look there but please do not change the defaults as they are now.
having it in .config makes it easy to sync over different unix machines
You could still sync it and just do a one time command d="$HOME/Library/Application Support/com.OCamlPro.ocp-indent/" && mkdir -p "$d" && ln -s $HOME/.config/ocp-indent/ "$d"
.
and just do a one time command
I'd rather suggest not to try to "fix" things that are not broken.
Hi,
The idea behind this PR is to change the way the global user-defined configuration file path is chosen, to make it more standard and to follow the suitable conventions on all platforms. I used directories.
With this PR, the path is computed as follow:
$XDG_CONFIG_HOME/ocp-indent/config
with$XDG_CONFIG_HOME
defaulting to$HOME/.config/
$HOME/Library/Application Support/com.OCamlPro.ocp-indent/config
{FOLDERID_ApplicationData}/OCamlPro/ocp-indent/config
; the path of{FOLDERID_ApplicationData}
can be obtained only using SHGetKnownFolderPathdirectories
has no dependency, except on Windows where it depends onctypes
, it works on all OCaml version from4.07
, but I haven't tested older versions.