mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 23:14:53 +09:00
Fully specify mod pack Factorio version
Remove support for major only versions of Factorio being specified in mod packs.
This commit is contained in:
1 parent
53a5d7ea6f
commit
660d0f08a1
3 files changed
+11
-11
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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.",
|
||||
}]}
|
||||
>
|
||||
<Input
|
||||
|
||||
@@ -823,13 +823,13 @@ describe("Integration of Clusterio", function() {
|
||||
|
||||
describe("mod-pack create", function() {
|
||||
it("should create a mod-pack", async function() {
|
||||
await execCtl("mod-pack create empty-pack 1.1");
|
||||
await execCtl("mod-pack create empty-pack 1.1.0");
|
||||
let response = await libLink.messages.listModPacks.send(getControl());
|
||||
assert(response.list.some(modPack => 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");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user