Releases: adrg/xdg
v0.5.3
Changelog
- Updated
xdg.SearchRuntimeFile
to also look in the operating system's temporary directory for runtime files.
This covers unlikely cases in which runtime files cannot be written relative to the base runtime directory either because it does not exist or it is not accessible, soxdg.RuntimeFile
suggests the operating system's temporary directory as a suitable fallback location.
Internal
- Improved package testing.
v0.5.2
Changelog
-
Updated logic of
xdg.RuntimeFile
: due to the special nature of theruntime directory
, the function no longer attempts to create it if it does not exist. If that's the case, the function uses the operating system'stemporary directory
as a fallback. The function still creates subdirectories relative to the base runtime directory or its fallback.Justification: the creation of the runtime directory is not in the scope of this package as it has special requirements defined by the XDG Base Directory Specification. Relevant excerpt:
The lifetime of the directory MUST be bound to the user being logged in. It MUST be created when the user first logs in and if the user fully logs out the directory MUST be removed. If the user logs in more than once they should get pointed to the same directory, and it is mandatory that the directory continues to exist from their first login to their last logout on the system, and not removed in between. Files in the directory MUST not survive reboot or a full logout/login cycle.
Also, on
Linux
, the parent directories of the default user runtime directory are owned by the root user so they cannot be created by a regular user. pam_systemd is usually responsible for creating the runtime directory (/run/user/$UID
).
v0.5.1
Changelog
- Added support for the non-standard
XDG_BIN_HOME
base directory.
See XDG base directories README section for more details. - Added more config and data search locations on
macOS
.- Added
~/.config
at the end of the list of default locations forXDG_CONFIG_DIRS
. - Added
~/.local/share
at the end of the list of default locations forXDG_DATA_DIRS
.
- Added
- Added more application search locations on
Windows
:%ProgramFiles%
%ProgramFiles%\Common Files
%LOCALAPPDATA%\Programs
%LOCALAPPDATA%\Programs\Common
Internal
- Updated
golang.org/x/sys
dependency to the latest version. - Improved package testing.
v0.5.0
Changelog
user-dirs.dirs
config file is now parsed on Unix-like operating systems (except for macOS and Plan 9).
See XDG user directories README section for more details.- Updated
golang.org/x/sys
dependency to the latest version.
Internal
- Moved all path related functionality in internal
pathutil
package. - Added internal
userdirs
package:- Moved
xdg.UserDirectories
touserdirs.Directories
. - Added parsing functions for
user-dirs.dirs
config file.
- Moved
- Improved package testing.
v0.4.0
Changelog
Windows
- Added support for Known Folders.
Appropriate folders are now used as defaults for XDG environment variables which are not set. - Added more search directories for config files.
- Added more search directories for applications.
- The fallback path for templates is now
%APPDATA%\Microsoft\Windows\Templates
instead of the legacy%USERPROFILE%\Templates
path.
See https://github.com/adrg/xdg#default-locations for more details.
Internal
- Code coverage is now 100%.
- Improved package structure.
- Improved documentation.
v0.3.4
Changelog
- Internal changes due to
$XDG_STATE_HOME
being added to the latest XDG Base Directory Specification. - Improved testing and coverage.
- Improved documentation.
v0.3.3
Changelog
- Added workaround for
os.Stat
bugs on Windows, described by issues golang/go#33357, microsoft/Windows-Containers#97 and golang/go#34900. On some Windows versions,os.Stat
returns an error for valid socket files and for symbolic links to directories. - Enabled build for the
js/wasm
architecture - Minor internal refactoring
- Improved testing
v0.3.2
v0.3.1
Changelog
- The default value for the
XDG_CONFIG_HOME
environment variable on macOS systems has been
changed from~/Library/Preferences
to~/Library/Application Support
. - The default value for the
XDG_CONFIG_DIRS
environment variable on macOS systems has been
changed from[/Library/Preferences]
to[~/Library/Preferences, /Library/Application Support, /Library/Preferences]
.
See more details regarding the change in PR #13.
NOTE: the package will still find config files placed relative to the ~/Library/Preferences
directory.
However, if XDG_CONFIG_HOME
is not set, it will suggest saving config files relative to the ~/Library/Application Support
directory.
v0.3.0
Changelog
- Implemented XDG state directory proposal
- Improved xdg.RuntimeFile function
- Improved test coverage
- Improved documentation