public static CfanJson createCfanJsonFromFile(string directoryOrZipFile) { ModInfoJson modInfo = FactorioModParser.parseMod(directoryOrZipFile); if (modInfo == null) { throw new Exception($"Couldn't parse info.json from '{directoryOrZipFile}'!"); } return(createCfanJsonFromModInfoJson(modInfo, new System.IO.FileInfo(directoryOrZipFile).Length)); }
protected static ModInfoJson parsePotentialMod(string directoryOrZipFile) { try { return(FactorioModParser.parseMod(directoryOrZipFile)); } catch (Exception e) { log.WarnFormat("Couldn't parse potential mod in {0}: {1}", directoryOrZipFile, e.Message); log.Debug(e, e); return(null); } }
public static ModVersion getModVersion(string path) { return(FactorioModParser.parseMod(path).version); }