fix(root): setup reads the default root as the system spells it
The portable macOS job: a root chosen at the default (`/tmp/.../Library/ Application Support/wanderbooks`) resolved to `/private/tmp/...` and read as somewhere else, so setup kept a record that should have gone. The default is taken from the canonical home, as a chosen root is. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
This commit is contained in:
1 parent
a08f7b5fac
commit
d326894c6e
1 file changed
+6
-1
@@ -505,7 +505,12 @@ impl Root {
|
|||||||
chosen: Option<&Path>,
|
chosen: Option<&Path>,
|
||||||
xdg_data_home: Option<&Path>,
|
xdg_data_home: Option<&Path>,
|
||||||
) -> Result<(Self, SetupReport), RootError> {
|
) -> Result<(Self, SetupReport), RootError> {
|
||||||
let default = default_root(home);
|
// The default as the system spells it, since a chosen root is
|
||||||
|
// resolved that way too: on macOS `/tmp` is `/private/tmp`, and a
|
||||||
|
// root chosen at the default must read as the default (so the
|
||||||
|
// record goes), not as somewhere else.
|
||||||
|
let default =
|
||||||
|
default_root(&std::fs::canonicalize(home).unwrap_or_else(|_| home.to_path_buf()));
|
||||||
let recorded = recorded_root(home)?;
|
let recorded = recorded_root(home)?;
|
||||||
let current = recorded.clone().unwrap_or_else(|| default.clone());
|
let current = recorded.clone().unwrap_or_else(|| default.clone());
|
||||||
let path = match (chosen, &recorded, xdg_data_home) {
|
let path = match (chosen, &recorded, xdg_data_home) {
|
||||||
|
|||||||
Reference in new issue
Block a user