Dragonfly Download Bin #198
							
								
								
									
										20485
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										20485
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -44,9 +44,14 @@
 | 
				
			|||||||
  },
 | 
					  },
 | 
				
			||||||
  "homepage": "https://docs.bdsmaneger.com/Bds Maneger core",
 | 
					  "homepage": "https://docs.bdsmaneger.com/Bds Maneger core",
 | 
				
			||||||
  "engines": {
 | 
					  "engines": {
 | 
				
			||||||
    "node": ">=15.6.0",
 | 
					    "node": ">=15.6.0"
 | 
				
			||||||
    "npm": ">=7"
 | 
					 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					  "os": [
 | 
				
			||||||
 | 
					    "linux",
 | 
				
			||||||
 | 
					    "darwin",
 | 
				
			||||||
 | 
					    "win32",
 | 
				
			||||||
 | 
					    "android"
 | 
				
			||||||
 | 
					  ],
 | 
				
			||||||
  "dependencies": {
 | 
					  "dependencies": {
 | 
				
			||||||
    "@azure/storage-blob": "^12.6.0",
 | 
					    "@azure/storage-blob": "^12.6.0",
 | 
				
			||||||
    "adm-zip": "^0.5.1",
 | 
					    "adm-zip": "^0.5.1",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,4 @@
 | 
				
			|||||||
const child_process = require("child_process");
 | 
					 | 
				
			||||||
const fs = require("fs");
 | 
					const fs = require("fs");
 | 
				
			||||||
const os = require("os");
 | 
					 | 
				
			||||||
const path = require("path");
 | 
					const path = require("path");
 | 
				
			||||||
const { writeFileSync, existsSync, readFileSync, readdirSync, rmSync } = fs;
 | 
					const { writeFileSync, existsSync, readFileSync, readdirSync, rmSync } = fs;
 | 
				
			||||||
const { join, resolve } = path;
 | 
					const { join, resolve } = path;
 | 
				
			||||||
@@ -328,24 +326,16 @@ module.exports.v2 = async (version = true) => {
 | 
				
			|||||||
        if (valid_platform.dragonfly) {
 | 
					        if (valid_platform.dragonfly) {
 | 
				
			||||||
            if (LocalServersVersions.dragonfly !== version) {
 | 
					            if (LocalServersVersions.dragonfly !== version) {
 | 
				
			||||||
                // Add info to ReturnObject
 | 
					                // Add info to ReturnObject
 | 
				
			||||||
                ReturnObject.url = "https://github.com/df-mc/dragonfly/tree/master";
 | 
					                ReturnObject.url = ServerDownloadJSON.dragonfly[version][process.platform][bds.arch]
 | 
				
			||||||
                ReturnObject.data = "";
 | 
					                ReturnObject.data = ServerDownloadJSON.dragonfly[version].data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                // Build Dragonfly
 | 
					                // Download
 | 
				
			||||||
                const TmpDragonflyDir = path.join(os.tmpdir(), `dragonfly_${Math.random().toString(36).substring(7)}`);
 | 
					                let DgBin = path.join(ServersPaths.dragonfly, "Dragonfly");
 | 
				
			||||||
                child_process.execFileSync("git", ["clone", "https://github.com/df-mc/dragonfly", "--depth", "1", TmpDragonflyDir]);
 | 
					                if (process.platform === "win32") DgBin += ".exe";
 | 
				
			||||||
                let DragonflyPackageOut = path.join(ServersPaths.dragonfly, "DragonFly");
 | 
					                fs.writeFileSync(DgBin, await Request.buffer(ReturnObject.url), "binary");
 | 
				
			||||||
                if (process.platform === "win32") DragonflyPackageOut += ".exe";
 | 
					 | 
				
			||||||
                child_process.execFileSync("go", ["build", "-o", DragonflyPackageOut], {cwd: TmpDragonflyDir});
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                // move Dragonfly to ServersPaths
 | 
					 | 
				
			||||||
                fs.renameSync(DragonflyPackageOut, path.join(ServersPaths.dragonfly, path.basename(DragonflyPackageOut)));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                // Remove Build Dir
 | 
					 | 
				
			||||||
                fs.rmSync(TmpDragonflyDir, {recursive: true, force: true});
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                // Update Server Version
 | 
					                // Update Server Version
 | 
				
			||||||
                bds.BdsSettigs.UpdateServerVersion(Math.random().toString(), CurrentPlatform);
 | 
					                bds.BdsSettigs.UpdateServerVersion(version, CurrentPlatform);
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                ReturnObject.skip = true;
 | 
					                ReturnObject.skip = true;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user