fix(setup): read MCPorter's XDG folder in the client configuration-root owner (#11193)

This commit is contained in:
morluto authored and GitHub committed 2026-11-15 10:13:14 -05:00
1 parent 8a6c315ab9
commit ec5cb5ec51
3 files changed
+44 -15

No files matched your search

+15
View File
@@ -5,6 +5,7 @@ import { expect, it } from "vitest";
import {
absoluteXdgConfigHome,
mcporterXdgConfigHome,
xdgConfigHomeOrDefault,
} from "./ClientConfigRoots.js";
@@ -24,6 +25,20 @@ it.each([
},
);
it.each([
[undefined, undefined],
["", undefined],
["relative", undefined],
[" ~/xdg ", "/home/user/xdg"],
["~", "/home/user"],
[" /custom ", "/custom"],
])("reads XDG_CONFIG_HOME=%j as MCPorter's folder %j", (value, expected) => {
const env = value === undefined ? {} : { XDG_CONFIG_HOME: value };
expect(mcporterXdgConfigHome({ home, platform: "linux", env })).toBe(
expected,
);
});
// Client root semantics differ per reader, so they are derived only here.
it("keeps client configuration-root variables in one owner", async () => {
const directory = fileURLToPath(new URL(".", import.meta.url));