mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-16 15:30:41 +09:00
Find a full install in host.factorio_directory instead of a setting
Per review, drop host.factorio_graphics_directory. findVersion takes a headless option that filters installs by build, telling them apart by data/base/graphics/icons. When the instance runs the headless build the export looks for a full install of the same major.minor version in the host's factorio directory. Server startup is unchanged. If none is found the export still runs, and the reason is included in the missing icons warning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
46c6153201
commit
37d74ca2a6
10 files changed
+132
-65
No files matched your search
@@ -105,6 +105,33 @@ describe("host/server", function() {
|
||||
);
|
||||
});
|
||||
});
|
||||
describe("headless option", function() {
|
||||
const mixedDir = path.join("test", "file", "factorio-mixed");
|
||||
it("should find only full installs when false", async function() {
|
||||
const [dir] = await hostServer.findVersion(mixedDir, "0.1.2", { headless: false });
|
||||
assert.equal(dir, path.join(mixedDir, "full", "data"));
|
||||
});
|
||||
it("should find only headless installs when true", async function() {
|
||||
const [dir] = await hostServer.findVersion(mixedDir, "0.1.2", { headless: true });
|
||||
assert.equal(dir, path.join(mixedDir, "headless", "data"));
|
||||
});
|
||||
it("should reject a direct install of the other build", async function() {
|
||||
const installDir = path.join(mixedDir, "headless");
|
||||
await assert.rejects(
|
||||
hostServer.findVersion(installDir, "0.1.2", { headless: false }),
|
||||
new Error(
|
||||
`Unable to find a full install of Factorio 0.1.2: ${installDir} is a direct ` +
|
||||
"(single-version) install of the headless build."
|
||||
)
|
||||
);
|
||||
});
|
||||
it("should reject if no install of that build has the version", async function() {
|
||||
await assert.rejects(
|
||||
hostServer.findVersion(path.join("test", "file", "factorio"), "0.1.2", { headless: true }),
|
||||
new Error("Unable to find headless Factorio version 0.1.2")
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("_listFactorioVersions()", function() {
|
||||
|
||||
Reference in new issue
Block a user