From e0161114e736b878a253caa38b4b19980ed145e9 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Sun, 21 Jan 2024 23:11:58 +0100 Subject: [PATCH] Fix --no-download-headless conflict in installer Fix installer incorrectly exiting with a conflicting options errors when the --no-download-headless option was used in conjunction with the --factorio-dir option. --- CHANGELOG.md | 1 + packages/create/create.js | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b4c4bf3..ca5d4e2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Fixed generated systemd file for clusteriohost not enabling source maps. - Fixed ctl not exporting types used for adding commands to ctl plugins. - Fixed controller only plugins throwing an error about missing a config field on startup out when added to hosts. +- Fixed installer incorrectly claiming the options --factorio-dir and --no-download-headless conflicts with each other. ## Version 2.0.0-alpha.14 diff --git a/packages/create/create.js b/packages/create/create.js index fca70256..c222ab04 100755 --- a/packages/create/create.js +++ b/packages/create/create.js @@ -612,7 +612,7 @@ async function inquirerMissingArgs(args) { }, ], answers); - if (answers.downloadHeadless) { + if (!answers.factorioDir && answers.downloadHeadless) { answers.factorioDir = "factorio"; } } @@ -760,7 +760,7 @@ async function main() { "Can be set to false using --no-download-headless.", type: "boolean", }) - .conflicts("factorio-dir", "download-headless"); + ; } args = args.argv; @@ -780,6 +780,9 @@ async function main() { let answers = await inquirerMissingArgs(args); if (answers.downloadHeadless) { + if (answers.factorioDir !== "factorio") { + throw new InstallError("--download-headless option requires --factorio-dir to be set to factorio"); + } await downloadLinuxServer(); }