mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 07:04:52 +09:00
1 parent
b093cd136f
commit
485504d885
2 files changed
+5
-6
No files matched your search
@@ -641,6 +641,7 @@ export default class Host extends lib.Link {
|
||||
} else {
|
||||
instanceInfo = this.discoveredInstanceInfos.get(instanceId);
|
||||
if (instanceInfo) {
|
||||
await Instance.populate_folders(instanceInfo.path);
|
||||
instanceInfo.config.update(config, true, "controller");
|
||||
|
||||
} else {
|
||||
@@ -650,7 +651,7 @@ export default class Host extends lib.Link {
|
||||
let instanceDir = await this._createNewInstanceDir(instanceConfig.get("instance.name"));
|
||||
|
||||
logger.info(`Creating ${instanceDir}`);
|
||||
await Instance.create(instanceDir, this.config.get("host.factorio_directory"));
|
||||
await Instance.populate_folders(instanceDir);
|
||||
instanceInfo = {
|
||||
path: instanceDir,
|
||||
config: instanceConfig,
|
||||
|
||||
@@ -661,14 +661,12 @@ rcon.print(game.table_to_json(players))`.replace(/\r?\n/g, " ");
|
||||
/**
|
||||
* Creates a new empty instance directory
|
||||
*
|
||||
* Creates the neccessary files for starting up a new instance into the
|
||||
* provided instance directory.
|
||||
* Ensures the neccessary files for starting up a new instance into the
|
||||
* provided instance directory are present.
|
||||
*
|
||||
* @param instanceDir -
|
||||
* Directory to create the new instance into.
|
||||
* @param factorioDir - Path to factorio installation.
|
||||
*/
|
||||
static async create(instanceDir: string, factorioDir: string) {
|
||||
static async populate_folders(instanceDir: string) {
|
||||
await fs.ensureDir(path.join(instanceDir, "script-output"));
|
||||
await fs.ensureDir(path.join(instanceDir, "saves"));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user