-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Follow XDG directories spec #251
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be curious how macOS users feel about ~/.local/share/phylum/completions
and ~/.local/bin/phylum`. For Linux that isn't unexpected but macOS users might be confused?
I think it would likely make sense to put this PR on ice until we've resolved how we want to make things like completions/path modification optional. It likely makes sense to follow |
I think this makes sense. Should we mark this as a draft so it doesn't accidentally get merged by someone? |
I don't actually think it's possible to convert existing PRs to drafts? Unless you're suggesting to close and re-open as draft. |
Decided to move things into a separate file in this PR, I think that's the easiest choice to avoid having to move things around multiple times. |
You should be able to, just click the |
Previously phylum's installer would put all files into `~/.phylum` and retrieve the configuration file from there. This leads to a rather cluttered home directory which is why the XDG directories spec is usually preferred. The CLI will now check the XDG config directory first (`${XDG_CONFIG_HOME:-${HOME}/.config}/phylum/settings.yaml`), then fall back to the old config path if that isn't present. The installer will put the completions in the XDG data directory (`${XDG_DATA_HOME:-${HOME}/.local/share}/phylum`) and the binary in `${HOME}/.local/bin/`. Since the `${HOME}/.local/bin` path is sometimes included in the path already, without being present in the shell config itself, we check the current `$PATH` first to try and detect if we need to add it or not. Closes #224.
Worth mentioning that technically Apple specifies using Personally I think this is unexpected for a CLI tool, so I'd vote to keep it under However it does raise the question, what is our story for Windows here? Looking at other apps (e.g. neovim, vs code), it seems many use |
Yes I agree, I've considered the
It seems like right now Windows support only exists through Linux shims anyway. But I would recommend |
Previously phylum's installer would put all files into
~/.phylum
andretrieve the configuration file from there. This leads to a rather
cluttered home directory which is why the XDG directories spec is
usually preferred.
The CLI will now check the XDG config directory first
(
${XDG_CONFIG_HOME:-${HOME}/.config}/phylum/settings.yaml
), then fallback to the old config path if that isn't present.
The installer will put the completions in the XDG data directory
(
${XDG_DATA_HOME:-${HOME}/.local/share}/phylum
) and the binary in${HOME}/.local/bin/
.Since the
${HOME}/.local/bin
path is sometimes included in the pathalready, without being present in the shell config itself, we check the
current
$PATH
first to try and detect if we need to add it or not.Closes #224.