mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 15:33:12 +09:00
Added 2.0 zip file name to version matcher (#671)
* Added 2.0 zip file name to version matcher Fixes: Install problem ? #668 * Add changelog entry for 671.
This commit is contained in:
1 parent
9d18d18603
commit
c31671d1e6
2 files changed
+6
-1
No files matched your search
@@ -746,7 +746,11 @@ async function downloadLinuxServer() {
|
||||
const url = new URL(res.headers.location);
|
||||
// get the filename of the latest factorio archive from redirected url
|
||||
const filename = path.posix.basename(url.pathname);
|
||||
const version = filename.match(/(?<=factorio_headless_x64_).*(?=\.tar\.xz)/)[0];
|
||||
const match = filename.match(/(?<=factorio_headless_x64_|factorio-headless_linux_)\d+\.\d+\.\d+(?=\.tar\.xz)/);
|
||||
if (!match || !match.length) {
|
||||
throw Error(`Unable to extract version from filename: ${filename}`);
|
||||
}
|
||||
const version = match[0];
|
||||
|
||||
const tmpDir = "temp/create-temp/";
|
||||
const archivePath = tmpDir + filename;
|
||||
|
||||
Reference in new issue
Block a user