Using factorio.app/Contents for MacOS

This commit is contained in:
Benjamin DROUARD committed 2021-03-21 16:43:32 +01:00
1 parent b78eafaedb
commit 058197dc99
2 files changed
+25 -25

No files matched your search

+8 -8
View File
@@ -190,19 +190,19 @@ up, and v10.16.0+.
1. Open Terminal or Command prompt in the directory you want to install to and run the following commands.
```bash
mkdir clusterio
cd clusterio
npm init -y
npm install @clusterio/master @clusterio/slave @clusterio/ctl
```
```bash
mkdir clusterio
cd clusterio
npm init -y
npm install @clusterio/master @clusterio/slave @clusterio/ctl
```
2. Obtain Factorio:
Install Factorio and copy the factorio.app in your clusterio install folder as factorio.
Install Factorio and copy the factorio.app/Contents in your clusterio install folder as factorio.
If you installed factorio on your mac you can run
```bash
cp /Applications/factorio.app/ factorio
cp -r /Applications/factorio.app/Contents/ factorio
```
## Installing Plugins
+17 -17
View File
@@ -832,7 +832,7 @@ class FactorioServer extends events.EventEmitter {
await this._writeConfigIni();
this._server = child_process.spawn(
this.getBinaryPath(),
this.binaryPath(),
[
"--config", this.writePath("config.ini"),
"--create", this.writePath("saves", name),
@@ -857,20 +857,6 @@ class FactorioServer extends events.EventEmitter {
}
}
/**
* Get Factorio binary path
*
* Get the path to the factorio binary depending on the platform (MacOS support)
*
* @return {string} path to factorio binary
*/
getBinaryPath() {
if (process.platform === "darwin") {
return this.dataPath("..", "MacOS", "factorio");
}
return this.dataPath("..", "bin", "x64", "factorio");
}
/**
* Start server
*
@@ -885,7 +871,7 @@ class FactorioServer extends events.EventEmitter {
await this._writeConfigIni();
this._server = child_process.spawn(
this.getBinaryPath(),
this.binaryPath(),
[
"--config", this.writePath("config.ini"),
"--start-server", this.writePath("saves", save),
@@ -920,7 +906,7 @@ class FactorioServer extends events.EventEmitter {
await this._writeConfigIni();
this._server = child_process.spawn(
this.getBinaryPath(),
this.binaryPath(),
[
"--config", this.writePath("config.ini"),
"--start-server-load-scenario", scenario,
@@ -1116,6 +1102,20 @@ class FactorioServer extends events.EventEmitter {
return path.join(this._dataDir, ...parts);
}
/**
* Get Factorio binary path
*
* Get the path to the factorio binary depending on the platform (MacOS support)
*
* @returns {string} Path to factorio binary
*/
binaryPath() {
if (process.platform === "darwin") {
return this.dataPath("..", "MacOS", "factorio");
}
return this.dataPath("..", "bin", "x64", "factorio");
}
/**
* Return path in write directory
*