Flyctl should follow the XDG Base Directory Specification

The $HOME/.fly directory should be moved to the appropriate directory under the XDG Base Directory Specification. $XDG_CONFIG_HOME/fly is probably appropriate. If t

I think we’re interested in being respectful of stuff like this, but no system I have has XDG_CONFIG_HOME set, including my Linux dev system. Can you say more about which users would be helped out by us adding the corner-case code for this?

Like, obviously, we’re not going to write Fly state to /etc/xdg on macOS.

If XDG_CONFIG_HOME is unset, the spec says apps will have to assume a default (~/.config).

Also, on MacOS, ~/Library/Preferences/fly would be a better place for this over ~/.fly.

Here’s a go library that figures out the correct directory with sensible defaults for Windows, Linux, OSX, and Plan 9: GitHub - adrg/xdg: Go implementation of the XDG Base Directory Specification and XDG user directories

It’s not really corner-case code right? A lot of the apps that I use daily follow the spec now. gcloud follows the spec correctly. If you open up ~/.config on your dev machine, you’ll see which apps follow this spec too.

Gotcha. It’s worth thinking about! Thanks for bringing it up.

1 Like