mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-22 16:13:12 +09:00
Merge pull request #1014 from bbassie/feature/patched-scenario
Add create-scenario command to clusteriohost
This commit is contained in:
11 files changed
+496
-36
No files matched your search
@@ -24,6 +24,7 @@ import * as lib from "@clusterio/lib";
|
||||
import { ConsoleTransport, levels, logger } from "@clusterio/lib";
|
||||
|
||||
import Host from "./src/Host.js";
|
||||
import { createScenarioCommand, handleCreateScenarioCommand } from "./src/create_scenario.js";
|
||||
|
||||
let host: Host | undefined;
|
||||
|
||||
@@ -119,6 +120,11 @@ async function startHost() {
|
||||
.option("bypass-lock-file", { hidden: true, type: "boolean", nargs: 0, default: false })
|
||||
.command("plugin", "Manage available plugins", lib.pluginCommand)
|
||||
.command("config", "Manage Host config", lib.configCommand)
|
||||
.command(
|
||||
"create-scenario <output>",
|
||||
"Create a scenario patched with modules for use outside Clusterio",
|
||||
createScenarioCommand,
|
||||
)
|
||||
.command("run", "Run host", yargs => {
|
||||
yargs.option("can-restart", {
|
||||
type: "boolean", nargs: 0, default: false,
|
||||
@@ -185,6 +191,11 @@ async function startHost() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (command === "create-scenario") {
|
||||
await handleCreateScenarioCommand(args, hostConfig, pluginInfos);
|
||||
return;
|
||||
}
|
||||
|
||||
// From this point on the host should run
|
||||
await hostConfigLock.acquire();
|
||||
|
||||
|
||||
Reference in new issue
Block a user