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

Move config file default path to os.UserConfigDir() #161

Open
wijayaerick opened this issue Dec 30, 2022 · 3 comments
Open

Move config file default path to os.UserConfigDir() #161

wijayaerick opened this issue Dec 30, 2022 · 3 comments

Comments

@wijayaerick
Copy link

Related with #116

os.UserConfigDir() docs:

On Unix systems, it returns $XDG_CONFIG_HOME as specified by https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html if non-empty, else $HOME/.config. On Darwin, it returns $HOME/Library/Application Support. On Windows, it returns %AppData%. On Plan 9, it returns $home/lib.

Currently .wegorc defaults to $HOME/.wegorc in all systems. I'm proposing this logic for searching/creating the config file:

  1. $WEGORC takes the highest precedence.
  2. If $WEGORC is not set, try to open the config file from os.UserConfigDir()/wego/wegorc (can adjust the name, but the point is it is stored inside os.UserConfigDir)
  3. If the config file is not found, fallback try to open the config file from $HOME/.wegorc for backward compatibility
  4. If still now found, generate the config file
    • in $WEGORC if it is set
    • else, generate the file in os.UserConfigDir()/wego/wegorc
@Madraceee
Copy link

Hey, I wanna know the status about this issue, Is it updated?
Else i can work on this

@Madraceee
Copy link

This seems like something which has to be updated in "ingo" rather than here
Can you help me with this?

@kordianbruck
Copy link
Collaborator

Yep, probably line 57 and following need adaption: https://github.com/schachmat/ingo/blob/master/in.go#L57

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

No branches or pull requests

3 participants