mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 15:04:52 +09:00
#59 added error handling when not having put token in config.json
This commit is contained in:
1 parent
52cc98cc95
commit
0f246ca9d3
1 file changed
+4
-2
@@ -25,7 +25,7 @@ modManager.listMods("shared");
|
||||
*/
|
||||
module.exports.listMods = function(instance){
|
||||
if(instance && instances.includes(instance)){
|
||||
factorioAPI.init(false, 'instances/'+instance+'/mods', 'instances/'+instance+'/saves', '0.15.37');
|
||||
factorioAPI.init(false, 'instances/'+instance+'/instanceMods', 'instances/'+instance+'/saves', '0.15.37');
|
||||
console.log("Authenticating to factorio.com...")
|
||||
factorioAPI.authenticate({
|
||||
username: config.username,
|
||||
@@ -45,12 +45,14 @@ module.exports.listMods = function(instance){
|
||||
})));
|
||||
});
|
||||
// Deactivated due to bug in node-factorio-api, see https://github.com/Danacus/node-factorio-api/issues/2
|
||||
|
||||
// bug is resolved, thanks to @Danacus and @brotherpot
|
||||
/*factorioAPI.getModsFromSaves().then(list => {
|
||||
console.log("Mods used in save:");
|
||||
console.log(JSON.stringify(list))
|
||||
console.log(asTable(list[0].mods))
|
||||
});*/
|
||||
}).catch(reason => {
|
||||
console.log("Failed to authenticate to factorio.com! Please check your connection and the username+token used for authentication in config.json");
|
||||
});
|
||||
} else {
|
||||
// list shared mods in /sharedMods/
|
||||
|
||||
Reference in new issue
Block a user