mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-22 16:13:12 +09:00
fixed #65
This commit is contained in:
1 parent
9496fa70e0
commit
f522f19cb5
3 files changed
+24
-9
No files matched your search
@@ -0,0 +1,14 @@
|
|||||||
|
const fileOps = require("./fileOps.js");
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
sync: function(){
|
||||||
|
let instances;
|
||||||
|
try {
|
||||||
|
instances = fileOps.getDirectoriesSync("./instances/");
|
||||||
|
} catch (e) {
|
||||||
|
// there are no instances created yet, probably missing the folder
|
||||||
|
instances = [];
|
||||||
|
}
|
||||||
|
return instances;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,7 +11,7 @@ const factorioAPI = require("node-factorio-api");
|
|||||||
const fileOps = require("./../fileOps.js");
|
const fileOps = require("./../fileOps.js");
|
||||||
const config = require("./../../config");
|
const config = require("./../../config");
|
||||||
|
|
||||||
const instances = fileOps.getDirectoriesSync("./instances/");
|
const instances = require("./../getInstances.js").sync();
|
||||||
/**
|
/**
|
||||||
Lists mods for an instance as a table. Warning, handles printing internally.
|
Lists mods for an instance as a table. Warning, handles printing internally.
|
||||||
@param {string} instance - Name of the instance or "shared"
|
@param {string} instance - Name of the instance or "shared"
|
||||||
@@ -130,3 +130,12 @@ module.exports.downloadFromGitURL = function(url){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
module.exports.findUpdates = function(){
|
||||||
|
console.log("Downloading mods...");
|
||||||
|
// get JSON data about releases
|
||||||
|
let res = syncRequest('GET', 'https://api.github.com/repos/Danielv123/factorioClusterioMod/releases', {"headers":{"User-Agent":"Fuck you for requiring user agents!"}});
|
||||||
|
let url = 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()))
|
||||||
|
}*/
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
module.exports.findUpdates = function(){
|
|
||||||
console.log("Downloading mods...");
|
|
||||||
// get JSON data about releases
|
|
||||||
let res = syncRequest('GET', 'https://api.github.com/repos/Danielv123/factorioClusterioMod/releases', {"headers":{"User-Agent":"Fuck you for requiring user agents!"}});
|
|
||||||
let url = 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()))
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user