mirror of
https://github.com/morluto/rea.git
synced 2026-11-22 14:35:45 +00:00
fix(setup): read MCPorter's XDG folder in the client configuration-root owner (#11193)
This commit is contained in:
1 parent
8a6c315ab9
commit
ec5cb5ec51
3 files changed
+44
-15
No files matched your search
@@ -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));
|
||||
|
||||
Reference in new issue
Block a user