-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add XDG Base Directory Specification support #7386
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We either need to use EnvironmentVariables.process()
instead of ProcessInfo.processInfo.environment
for improved Windows handling in the future, or exclude this logic on Windows altogether.
Co-authored-by: Max Desiatov <[email protected]>
@swift-ci test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@swift-ci test |
@swift-ci test windows |
Thank you!! |
Thank you for working on this! Will this be released in Swift 6.0, or maybe earlier? |
5.10 has been released already. Swift 6.0 is branching off |
### Motivation: As discussed in swiftlang#6204, users would like to have a clean home directory. And in the discussions following the merge of swiftlang#3430, it seems there is a willingness to adhere to the XDG spec, and support `~/.config/swiftpm`. ### Modifications: If the `XDG_CONFIG_HOME` environmental variable is defined, use `$XDG_CONFIG_HOME/swiftpm` as the root `dotSwiftPM` directory. ### Result: The symlinks that were previously stored in `~/.swiftpm` are now stored in `$XDG_CONFIG_HOME/swiftpm` when this variable is defined, therefore not cluttering the home directory of users. Closes swiftlang#6204 --------- Co-authored-by: Max Desiatov <[email protected]>
### Motivation: As discussed in swiftlang#6204, users would like to have a clean home directory. And in the discussions following the merge of swiftlang#3430, it seems there is a willingness to adhere to the XDG spec, and support `~/.config/swiftpm`. ### Modifications: If the `XDG_CONFIG_HOME` environmental variable is defined, use `$XDG_CONFIG_HOME/swiftpm` as the root `dotSwiftPM` directory. ### Result: The symlinks that were previously stored in `~/.swiftpm` are now stored in `$XDG_CONFIG_HOME/swiftpm` when this variable is defined, therefore not cluttering the home directory of users. Closes swiftlang#6204 --------- Co-authored-by: Max Desiatov <[email protected]>
Motivation:
As discussed in #6204, users would like to have a clean home directory.
And in the discussions following the merge of #3430, it seems there is a willingness to adhere to the XDG spec, and support
~/.config/swiftpm
.Modifications:
If the
XDG_CONFIG_HOME
environmental variable is defined, use$XDG_CONFIG_HOME/swiftpm
as the rootdotSwiftPM
directory.Result:
The symlinks that were previously stored in
~/.swiftpm
are now stored in$XDG_CONFIG_HOME/swiftpm
when this variable is defined, therefore not cluttering the home directory of users.Closes #6204