mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-24 08:23:12 +09:00
Link lib/scenarios instead of copying it
Link the instance directory's scenario folder to lib/scenarios instead of copying it. This ensures it stays up to date.
This commit is contained in:
1 parent
cbcf868c9e
commit
33e9f9d983
3 files changed
+5
-6
No files matched your search
@@ -16,6 +16,8 @@ Version 2.0.0
|
|||||||
- Replaced the per instance copy of the shared Factorio mods with
|
- Replaced the per instance copy of the shared Factorio mods with
|
||||||
symlinks. On Windows hard links are used instead due to the
|
symlinks. On Windows hard links are used instead due to the
|
||||||
privileges requirements of symlinks.
|
privileges requirements of symlinks.
|
||||||
|
- Changed the per instance scenario folder to be linked instead of
|
||||||
|
copied on instance creation.
|
||||||
|
|
||||||
### Breaking Changes
|
### Breaking Changes
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ const child_process = require('child_process');
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const syncRequest = require('sync-request');
|
const syncRequest = require('sync-request');
|
||||||
const request = require("request");
|
const request = require("request");
|
||||||
const ncp = require('ncp').ncp;
|
|
||||||
const Rcon = require('rcon-client-fork').Rcon;
|
const Rcon = require('rcon-client-fork').Rcon;
|
||||||
const deepmerge = require("deepmerge");
|
const deepmerge = require("deepmerge");
|
||||||
const getMac = require('getmac').getMac;
|
const getMac = require('getmac').getMac;
|
||||||
@@ -392,10 +391,9 @@ async function createInstance(config, args, instance) {
|
|||||||
console.log(`Creating ${instance.path()}`);
|
console.log(`Creating ${instance.path()}`);
|
||||||
await fs.ensureDir(instance.path());
|
await fs.ensureDir(instance.path());
|
||||||
await fs.ensureDir(instance.path("script-output"));
|
await fs.ensureDir(instance.path("script-output"));
|
||||||
fs.mkdirSync(instance.path("scenarios"));
|
let target = path.join("lib", "scenarios");
|
||||||
ncp("lib/scenarios", instance.path("scenarios"), err => {
|
let link = instance.path("scenarios");
|
||||||
if (err) console.error(err)
|
await fs.symlink(path.relative(path.dirname(link), target), link, 'junction');
|
||||||
});
|
|
||||||
|
|
||||||
fs.writeFileSync(instance.path("config.ini"), `[path]\r\n
|
fs.writeFileSync(instance.path("config.ini"), `[path]\r\n
|
||||||
read-data=${ path.resolve(config.factorioDirectory, "data") }\r\n
|
read-data=${ path.resolve(config.factorioDirectory, "data") }\r\n
|
||||||
|
|||||||
@@ -55,7 +55,6 @@
|
|||||||
"mkdirp": "^0.5.1",
|
"mkdirp": "^0.5.1",
|
||||||
"mkdirp-promise": "^5.0.1",
|
"mkdirp-promise": "^5.0.1",
|
||||||
"moment": "^2.22.2",
|
"moment": "^2.22.2",
|
||||||
"ncp": "^2.0.0",
|
|
||||||
"needle": "^2.4.0",
|
"needle": "^2.4.0",
|
||||||
"node-factorio-api": "^0.3.8",
|
"node-factorio-api": "^0.3.8",
|
||||||
"node-forge": "^0.7.1",
|
"node-forge": "^0.7.1",
|
||||||
|
|||||||
Reference in new issue
Block a user