TaKO8Ki / frum

A little bit fast and modern Ruby version manager written in Rust
MIT License
628 stars 15 forks source link

Add XDG configuration #85

Open bkuhlmann opened 3 years ago

bkuhlmann commented 3 years ago

Overview

Would it be possible to add XDG support so our $HOME directories don't get polluted with Frum application data?

Steps to Recreate

By default all Ruby versions are installed in $HOME/.frum which pollutes the $HOME directory. Additionally, when using Frum, I have to use the following Bash aliases to ensure Frum uses proper XDG paths:

alias fmi="frum --frum-dir '$HOME/.cache/frum' install"
alias fms="frum --frum-dir '$HOME/.cache/frum' local"
alias fmu="frum --frum-dir '$HOME/.cache/frum' uninstall"
alias fmv="frum --frum-dir '$HOME/.cache/frum' versions"

Desired Behavior

I would like Frum to use XDG defaults by default. Example:

Along the above lines, it might be nice to add the following command line arguments:

frum --config-dir # <= `$HOME/.config/frum`
frum --cache-dir # <= `$HOME/.cache/frum`

↑ The above would allow anyone to override the config or cache from the command line but these could also be put in $HOME/.config/frum/configuration.yml as a global configuration too so no one would have to use those CLI flags all of the time. Example:

config: "$HOME/.config/frum/configuration.yml"
cache: "$HOME/.cache/frum"

(these would be the defaults but anyone could customize those settings to non-XDG specifications if they desire).

This will allow all of us to enjoy Frum based on the XDG specification and keep our $HOME directory tidy. :tada:

Environment