mirror of
https://github.com/apple/pkl.git
synced 2026-08-27 22:24:03 +02:00
Use XDG base directories and Known Folders on Windows (#1809)
This changes logic that previously read/wrote from `~/.pkl` to use XDG base directories (all OSes), and Known Folders locations on Windows. For example, Pkl will look for `settings.pkl` in: 1. `$XDG_CONFIG_HOME/pkl/settings.pkl` 2. `%APPDATA/pkl/settings.pkl` 3. `~/.pkl/settings.pkl` 4. Path pkl/settings/pkl within `$XDG_CONFIG_DIRS` 5. `/etc/xdg/pkl/settings.pkl` --------- Co-authored-by: Florin Ungur <florin@florinungur.com>
This commit is contained in:
co-authored by
Florin Ungur
parent
4dd37219c0
commit
6551a59f9e
@@ -13,7 +13,43 @@ include::partial$intro.adoc[]
|
||||
|
||||
== Noteworthy [small]#🎶#
|
||||
|
||||
=== XXX
|
||||
=== CLI Changes
|
||||
|
||||
==== Default file locations
|
||||
|
||||
For new setups, the CLI no longer stores anything under `~/.pkl` (https://github.com/apple/pkl/pull/1809[#1809]).
|
||||
|
||||
It uses XDG-style locations on Unix and Known Folder locations on Windows:
|
||||
|
||||
[cols="1,2,2,2",options="header"]
|
||||
|===
|
||||
| Concern | Unix (Linux/macOS) | Windows | Legacy fallback
|
||||
|
||||
| Package cache
|
||||
| `~/.cache/pkl`
|
||||
| `$LOCALAPPDATA/pkl/Cache`
|
||||
| none
|
||||
|
||||
| Settings file
|
||||
| `~/.config/pkl/settings.pkl`
|
||||
| `$APPDATA/pkl/settings.pkl`
|
||||
| `~/.pkl/settings.pkl`
|
||||
|
||||
| CA certificates
|
||||
| `~/.config/pkl/cacerts`
|
||||
| `$APPDATA/pkl/cacerts`
|
||||
| `~/.pkl/cacerts`
|
||||
|
||||
| REPL history
|
||||
| `~/.local/state/pkl/repl-history`
|
||||
| `$LOCALAPPDATA/pkl/repl-history`
|
||||
| none
|
||||
|===
|
||||
|
||||
On every OS, these locations can be overridden with XDG-style env vars.
|
||||
For example, setting `XDG_CACHE_HOME` will configure the cache directory.
|
||||
|
||||
Note that the existing `~/.pkl/cache` directory is ignored, so Pkl will download packages to populate its cache if configured to do so.
|
||||
|
||||
== Breaking Changes [small]#💔#
|
||||
|
||||
|
||||
Reference in New Issue
Block a user