Skip to content
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

change default directory for $GNO_HOME on gnokey #655

Closed
thehowl opened this issue Mar 27, 2023 · 3 comments
Closed

change default directory for $GNO_HOME on gnokey #655

thehowl opened this issue Mar 27, 2023 · 3 comments

Comments

@thehowl
Copy link
Member

thehowl commented Mar 27, 2023

#141 introduced ~/.gno as the default "home directory" used in gnokey. I see the PR has introduced it without much discussion, so I'd like to bring it up here (and eventually change that).

My personal preference is that I generally have a strong distaste for software that creates more directories in my home dir. On top of this, this is generally not equivalent across platforms (ie., while creating ~/.gno will succeed on Windows, it will not be a hidden directory).

My proposal is to use os.UserConfigDir() joined with "gno".
The default behaviour should still be backwards compatible, so if ~/.gno is an existing directory, then that should be used by default instead. And of course, $GNO_HOME is honoured as an environment var is set.

(From discussion on #652)

@moul
Copy link
Member

moul commented Mar 27, 2023

Sounds good to me. Anyone with another proposal?

Note that at this stage we don't need to ensure backward compatibility for such things.

@moul
Copy link
Member

moul commented Mar 29, 2023

After researching other projects with similar concerns, I believe that os.UserConfigDir is the ideal and comprehensive solution.

Since we are only supporting recent versions of Golang, we do not need to worry about running code with versions prior to Go 1.12.

For motivation in the right direction, check out this example: moby/moby#40848.

@thehowl
Copy link
Member Author

thehowl commented Apr 18, 2023

#719

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

2 participants