Use factorioDir for alt-host config

Source the factorio installation from the host config for the alt host
test like with other tests.
This commit is contained in:
Hornwitser committed 2024-09-14 14:58:55 +02:00
1 parent 8e21290b22
commit 64cc9c2b64
1 file changed
+3 -2
+3 -2
View File
@@ -13,7 +13,7 @@ const { wait } = lib;
const testStrings = require("../lib/factorio/test_strings");
const {
TestControl, TestControlConnector, url, controlToken, slowTest,
get, exec, execCtl, sendRcon, getControl, spawn, instancesDir,
exec, execCtl, sendRcon, getControl, spawn, instancesDir, factorioDir,
} = require("./index");
@@ -41,7 +41,8 @@ async function startAltHost() {
await execCtl(`host create-config --id 5 --name alt-host --generate-token --output ${config}`);
await exec(`node ../../packages/host --config ${config} config set host.tls_ca ../../test/file/tls/cert.pem`);
await exec(`node ../../packages/host --config ${config} config set host.instances_directory alt-instances`);
await exec(`node ../../packages/host --config ${config} config set host.factorio_directory ../../factorio`);
const dir = path.isAbsolute(factorioDir) ? factorioDir : path.join("..", "..", factorioDir);
await exec(`node ../../packages/host --config ${config} config set host.factorio_directory ${dir}`);
await exec(`node ../../packages/host --config ${config} config set host.mods_directory alt-mods`);
return await spawnAltHost(config);
}