diff --git a/packages/ctl/src/commands.js b/packages/ctl/src/commands.js index 6173e808..354a6460 100644 --- a/packages/ctl/src/commands.js +++ b/packages/ctl/src/commands.js @@ -991,8 +991,8 @@ modPackCommands.add(new libCommand.Command({ modPack.name = args.name; if (args.description) { modPack.description = args.description; } if (args.factorioVersion) { - if (!/^\d+\.\d+(\.\d+)?$/.test(args.factorioVersion)) { - throw new libErrors.CommandError("factorio-version must match the format digit.digit[.digit]"); + if (!/^\d+\.\d+\.\d+?$/.test(args.factorioVersion)) { + throw new libErrors.CommandError("factorio-version must match the format digit.digit.digit"); } modPack.factorioVersion = args.factorioVersion; } @@ -1031,8 +1031,8 @@ modPackCommands.add(new libCommand.Command({ if (args.name) { modPack.name = args.name; } if (args.description) { modPack.description = args.description; } if (args.factorioVersion) { - if (!/^\d+\.\d+(\.\d+)?$/.test(args.factorioVersion)) { - throw new libErrors.CommandError("factorio-version must match the format digit.digit[.digit]"); + if (!/^\d+\.\d+\.\d+?$/.test(args.factorioVersion)) { + throw new libErrors.CommandError("factorio-version must match the format digit.digit.digit"); } modPack.factorioVersion = args.factorioVersion; } diff --git a/packages/web_ui/src/components/ModPackViewPage.jsx b/packages/web_ui/src/components/ModPackViewPage.jsx index 39264fe1..115560a3 100644 --- a/packages/web_ui/src/components/ModPackViewPage.jsx +++ b/packages/web_ui/src/components/ModPackViewPage.jsx @@ -620,8 +620,8 @@ export default function ModPackViewPage() { name="factorioVersion" style={{ marginBottom: 0 }} rules={[{ - pattern: /^\d+\.\d+(\.\d+)?$/, - message: "Must be an a.b or a.b.c version number..", + pattern: /^\d+\.\d+\.\d+?$/, + message: "Must be an a.b.c version number.", }]} > modPack.name === "empty-pack"), "created pack is not in the list"); }); it("should allow setting all fields", async function() { await execCtl( - "mod-pack create full-pack 0.17 " + + "mod-pack create full-pack 0.17.59 " + "--description Description " + "--mods empty_mod:1.0.0 " + "--bool-setting startup MyBool true " + @@ -844,7 +844,7 @@ describe("Integration of Clusterio", function() { reference.id = modPack.id; reference.name = "full-pack"; reference.description = "Description"; - reference.factorioVersion = "0.17"; + reference.factorioVersion = "0.17.59"; reference.mods.set("empty_mod", { name: "empty_mod", enabled: true, version: "1.0.0" }); reference.settings["startup"].set("MyBool", { value: true }); reference.settings["runtime-global"].set("MyInt", { value: 1235 }); @@ -868,11 +868,11 @@ describe("Integration of Clusterio", function() { describe("mod-pack edit", function() { it("runs", async function() { - await execCtl("mod-pack edit full-pack --factorio-version 1.2"); + await execCtl("mod-pack edit full-pack --factorio-version 1.2.0"); let response = await libLink.messages.listModPacks.send(getControl()); let modPack = response.list.find(entry => entry.name === "full-pack"); assert(modPack, "created mod pack not found"); - assert.equal(modPack.factorio_version, "1.2"); + assert.equal(modPack.factorio_version, "1.2.0"); }); });