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

XDG CONFIG DIR #1258

Closed
2 tasks done
xiagw opened this issue Sep 24, 2024 · 3 comments
Closed
2 tasks done

XDG CONFIG DIR #1258

xiagw opened this issue Sep 24, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@xiagw
Copy link

xiagw commented Sep 24, 2024

Description

https://wiki.archlinux.org/title/XDG_Base_Directory
现在一般都是在 $HOME/.config/ 目录下面放配置文件,
是否把默认配置文件放到 .config/ 下面?

Problem

默认配置文件不太规范

Other Description

No response

Checklist

  • I am using the latest version and have confirmed that the feature is not yet implemented in the latest version
  • I have searched for similar feature requests before submitting this one
@xiagw xiagw added the enhancement New feature or request label Sep 24, 2024
@jeessy2
Copy link
Owner

jeessy2 commented Sep 24, 2024

默认当前用户目录下。不改,改了默认地址升级后全都用不了。

@xiagw
Copy link
Author

xiagw commented Oct 9, 2024

这个倒是不会,
可以参考 aliyun-cli 或 kubectl 之类的,有个命令参数配置 或 环境变量 指定 配置文件路径
在程序内也可以做一个 if 判断,
优先查找 .config/
其次查找 $HOME/
就能做到兼容旧、新版

@jeessy2
Copy link
Owner

jeessy2 commented Oct 9, 2024

有些系统可能没有.config目录。目前正常使用,暂不考虑

@jeessy2 jeessy2 closed this as completed Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants