mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-14 23:24:52 +09:00
More mod manager stuff, node client.js list is more informative
Now shows nice table with name and port to connect to
This commit is contained in:
1 parent
1eeb289669
commit
8cf85f3ecc
3 files changed
+63
-4
No files matched your search
@@ -28,3 +28,21 @@ module.exports.listMods = function(instance){
|
||||
console.log(JSON.parse(res.getBody()))
|
||||
*/
|
||||
}
|
||||
|
||||
// 'https://api.github.com/repos/Danielv123/factorioClusterioMod/releases'
|
||||
module.exports.downloadFromGitURL = function(url){
|
||||
console.log("Downloading mod from "+url);
|
||||
// get JSON data about releases
|
||||
let res = syncRequest('GET', url, {"headers":{"User-Agent":"Please don't require setting a user agent"}});
|
||||
let downloadUrl = JSON.parse(res.getBody())[0].assets[0].browser_download_url;
|
||||
let name = JSON.parse(res.getBody())[0].assets[0].name;
|
||||
console.log(JSON.parse(res.getBody()))
|
||||
if(downloadUrl) {
|
||||
console.log(downloadUrl);
|
||||
var file = fs.createWriteStream("sharedMods/"+name);
|
||||
var request = https.get(downloadUrl, function(response) {
|
||||
response.pipe(file);
|
||||
console.log("Downloaded "+name);
|
||||
});
|
||||
}
|
||||
}
|
||||
File renamed without changes.
Reference in new issue
Block a user